perm filename PAGE22.PAS[WEB,ALS] blob sn#666053 filedate 1982-07-08 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00009 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	{899}{902}
C00014 00003	  {956}
C00030 00004	  {1005}
C00054 00005	  {1065}
C00077 00006	  {1134}
C00094 00007	  {1205}{1206}
C00128 00008	  {1185}{1189}
C00145 00009	  {1196}{PROCEDURE DEBUGHELP
C00150 ENDMK
C⊗;
{899}{902}
PROCEDURE Missingfont;
  BEGIN
  printnl(692);
  BEGIN
  helpptr:=4;
  helpline[3]:=693;
  helpline[2]:=694;
  helpline[1]:=695;
  helpline[0]:=696;
  END;
  error;
  END;
  {912}
PROCEDURE Appspace;
  VAR
    p:halfword;
    q:halfword;
    f:internalfont;
    k:0..fontmemsize;
  BEGIN
  IF(curlist.auxfield>=2000)AND(eqtb[2373].hh.rh<>0)THEN
    q:=
    newparamglue(12)
  ELSE
    BEGIN
    IF eqtb[2372].hh.rh<>0 THEN
      p:=eqtb[2372].hh.
      rh
    ELSE
      {911}
      BEGIN
      p:=fontglue[eqtb[2893].hh.rh];
      IF p=0 THEN
	BEGIN
	f:=eqtb[2893].hh.rh;
	p:=newspec(0);
	k:=parambase[f]+2;
	mem[p+1].int:=fontinfo[k].int;
	mem[p+2].int:=fontinfo[k+1].int;
	mem[p+3].int:=fontinfo[k+2].int;
	fontglue[f]:=p;
	END;
      END;
    p:=newspec(p);
    {913}
    IF curlist.auxfield>=2000 THEN
      mem[p+1].int:=mem[p+1].int+fontinfo[
					  7+parambase[eqtb[2893].hh.rh]].int;
    mem[p+2].int:=xnoverd(mem[p+2].int,curlist.auxfield,1000);
    mem[p+3].int:=xnoverd(mem[p+3].int,1000,curlist.auxfield);
    q:=newglue(p);
    mem[p].hh.rh:=0;
    END;
  mem[curlist.tailfield].hh.rh:=q;
  curlist.tailfield:=q;
  END;
  {918}
PROCEDURE Insertdollar;
  BEGIN
  printnl(699);
  BEGIN
  helpptr:=2;
  helpline[1]:=700;
  helpline[0]:=701;
  END;
  backerror;
  curcmd:=3;
  curchr:=36;
  curtok:=804;
  END;
  {920}
PROCEDURE Youcant;
  BEGIN
  printnl(702);
  printcmdchr(curcmd,curchr);
  print(703);
  printmode(curlist.modefield);
  END;
  {921}
PROCEDURE Reportillega;
  BEGIN
  Youcant;
  BEGIN
  helpptr:=4;
  helpline[3]:=704;
  helpline[2]:=705;
  helpline[1]:=706;
  helpline[0]:=707;
  END;
  error;
  END;
  {922}
FUNCTION Privileged:boolean;
  BEGIN
  IF curlist.modefield>0 THEN
    Privileged:=true
  ELSE
    BEGIN
    Reportillega;
    Privileged:=false;
    END;
  END;
  {929}
PROCEDURE Appendglue;
  VAR
    s:smallnumber;
  BEGIN
  s:=curchr;
  CASE s OF
    0:curval:=4;
    1:curval:=8;
    2:curval:=12;
    3:curval:=16;
    4:scanglue(false);
    5:scanglue(true);
    END;
  BEGIN
  mem[curlist.tailfield].hh.rh:=newglue(curval);
  curlist.tailfield:=mem[curlist.tailfield].hh.rh;
  END;
  IF s>=4 THEN
    BEGIN
    mem[curval].hh.rh:=mem[curval].hh.rh-1;
    IF s>4 THEN
      mem[curlist.tailfield].hh.b1:=98;
    END;
  END;
  {930}
PROCEDURE Appendkern;
  VAR
    s:quarterword;
  BEGIN
  s:=curchr;
  scandimen(s=98,false,false);
  BEGIN
  mem[curlist.tailfield].hh.rh:=newkern(curval);
  curlist.tailfield:=mem[curlist.tailfield].hh.rh;
  END;
  mem[curlist.tailfield].hh.b1:=s;
  END;
  {933}
PROCEDURE Offsave;
  VAR
    p:halfword;
  BEGIN
  IF curgroup=0 THEN
    {936}
    BEGIN
    printnl(726);
    printcmdchr(curcmd,curchr);
    BEGIN
    helpptr:=1;
    helpline[0]:=727;
    END;
    error;
    END
  ELSE
    BEGIN
    backinput;
    p:=getavail;
    mem[12003].hh.rh:=p;
    printnl(718);
    {935}
    CASE curgroup OF
      15:BEGIN
	mem[p].hh.lh:=6453;
	printesc(335);
	END;
      16:BEGIN
	mem[p].hh.lh:=804;
	printchar(36);
	END;
      17:BEGIN
	mem[p].hh.lh:=6454;
	mem[p].hh.rh:=getavail;
	p:=mem[p].hh.rh;
	mem[p].hh.lh:=3118;
	printesc(725);
	END;
      OTHERS:BEGIN
	mem[p].hh.lh:=637;
	printchar(125);
	END
      END;
    print(719);
    begintokenli(mem[12003].hh.rh,3);
    BEGIN
    helpptr:=5;
    helpline[4]:=720;
    helpline[3]:=721;
    helpline[2]:=722;
    helpline[1]:=723;
    helpline[0]:=724;
    END;
    error;
    END;
  END;
  {939}
PROCEDURE Extrarightbr;
  BEGIN
  printnl(732);
  CASE curgroup OF
    15:printesc(335);
    16:printchar(36);
    17:printesc(608);
    END;
  BEGIN
  helpptr:=5;
  helpline[4]:=733;
  helpline[3]:=734;
  helpline[2]:=735;
  helpline[1]:=736;
  helpline[0]:=737;
  END;
  error;
  alignstate:=alignstate+1;
  END;
  {945}
PROCEDURE Boxend;
  VAR
    p:halfword;
  BEGIN
  IF savestack[saveptr+0].int<0 THEN
    {946}
    BEGIN
    IF curbox<>0 THEN
      BEGIN
      mem[curbox+4].int:=savestack[saveptr+0].int;
      IF Abs(curlist.modefield)=1 THEN
	BEGIN
	appendtovlis(curbox);
	IF curlist.modefield>0 THEN
	  buildpage;
	END
      ELSE
	BEGIN
	IF Abs(curlist.modefield)=185 THEN
	  BEGIN
	  p:=newnoad;
	  mem[p+1].hh.rh:=2;
	  mem[p+1].hh.lh:=curbox;
	  curbox:=p;
	  END;
	mem[curlist.tailfield].hh.rh:=curbox;
	curlist.tailfield:=curbox;
	END;
      END;
    END
  ELSE
    IF savestack[saveptr+0].int<1073742336 THEN
      {947}
      IF savestack[
		   saveptr+0].int<1073742080 THEN
	eqdefine(-1073739187+savestack[saveptr+0]
		 .int,100,curbox)
      ELSE
	geqdefine(-1073739443+savestack[saveptr+0].int,100,
		  curbox)
    ELSE
      IF curbox<>0 THEN
	IF savestack[saveptr+0].int>1073742336
	THEN
	  {948}
	  BEGIN{362}
	  REPEAT
	    getnctoken;
	  UNTIL curcmd<>10;
	  IF((curcmd=26)AND(Abs(curlist.modefield)<>1))OR((curcmd=27)AND(Abs(
									     curlist.modefield)=1))THEN
	    BEGIN
	    Appendglue;
	    mem[curlist.tailfield].hh.b1:=savestack[saveptr+0].int-1073741211;
	    mem[curlist.tailfield+1].hh.rh:=curbox;
	    END
	  ELSE
	    BEGIN
	    printnl(752);
	    BEGIN
	    helpptr:=3;
	    helpline[2]:=753;
	    helpline[1]:=754;
	    helpline[0]:=755;
	    END;
	    error;
	    flushnodelis(curbox);
	    END;
	  END
	ELSE
	  shipout(curbox);
  END;
  {949}
PROCEDURE Beginbox;
  LABEL
    10;
  VAR
    p:halfword;
    k:halfword;
    n:eightbits;
  BEGIN
  CASE curchr OF
    0:BEGIN
      scaneightbit;
      curbox:=eqtb[2637+curval].hh.rh;
      eqtb[2637+curval].hh.rh:=0;
      END;
    1:BEGIN
      scaneightbit;
      curbox:=copynodelist(eqtb[2637+curval].hh.rh);
      END;
    2:{950}BEGIN
      curbox:=0;
      IF(curlist.modefield=1)AND(curlist.headfield=curlist.tailfield)THEN
	{951}
	BEGIN
	Youcant;
	BEGIN
	helpptr:=2;
	helpline[1]:=756;
	helpline[0]:=757;
	END;
	error;
	END
      ELSE
	BEGIN
	IF NOT(curlist.tailfield>12000)THEN
	  IF(mem[curlist.
		 tailfield].hh.b0=0)OR(mem[curlist.tailfield].hh.b0=1)THEN
	    BEGIN
	    p:=
	    curlist.headfield;
	    curbox:=curlist.tailfield;
	    WHILE mem[p].hh.rh<>curlist.tailfield DO p:=mem[p].hh.rh;
	    curlist.tailfield:=p;
	    mem[p].hh.rh:=0;
	    END;
	END;
      END;
    3:{952}BEGIN
      scaneightbit;
      n:=curval;
      IF NOT scankeyword(576)THEN
	BEGIN
	printnl(758);
	BEGIN
	helpptr:=2;
	helpline[1]:=759;
	helpline[0]:=760;
	END;
	error;
	END;
      scandimen(false,false,false);
      curbox:=vsplit(n,curval);
      END;
    OTHERS:{953}BEGIN
      k:=curchr-4;
      saveptr:=saveptr+1;
      scanspec;
      IF k=93 THEN
	newsavelevel(2)
      ELSE
	IF k=1 THEN
	  newsavelevel(3)
	ELSE
	  BEGIN
	  newsavelevel(4);
	  k:=1;
	  END;
      pushnest;
      curlist.modefield:=-k;
      IF k=1 THEN
	curlist.auxfield:=-65536000
      ELSE
	curlist.auxfield:=1000;
      END
    END;
  Boxend;
  10:
  END;
  {954}
PROCEDURE Scanbox;
  BEGIN{362}
  REPEAT
    getnctoken;
  UNTIL curcmd<>10;
  IF curcmd=21 THEN
    Beginbox
  ELSE
    IF(savestack[saveptr+0].int>=1073742337)
      AND((curcmd=36)OR(curcmd=35))THEN
      BEGIN
      curbox:=scanrulespec;
      Boxend;
      END
    ELSE
      BEGIN
      printnl(761);
      BEGIN
      helpptr:=3;
      helpline[2]:=762;
      helpline[1]:=763;
      helpline[0]:=764;
      END;
      backerror;
      END;
  END;

  {956}
PROCEDURE Package(c:smallnumber);
  VAR
    h:scaled;
    f:internalfont;
    p:halfword;
  BEGIN
  unsave;
  saveptr:=saveptr-3;
  IF curlist.modefield=-93 THEN
    curbox:=hpack(mem[curlist.headfield].hh.rh
		  ,savestack[saveptr+2].int,savestack[saveptr+1].int)
  ELSE
    BEGIN
    curbox:=
    vpackage(mem[curlist.headfield].hh.rh,savestack[saveptr+2].int,savestack
	     [saveptr+1].int,134217727);
    IF c=4 THEN
      {957}
      BEGIN
      h:=0;
      p:=mem[curbox+5].hh.rh;
      IF p<>0 THEN
	IF(mem[p].hh.b0=0)OR(mem[p].hh.b0=1)OR(mem[p].hh.b0=2)THEN
	  h:=mem[p+3].int;
      mem[curbox+2].int:=mem[curbox+2].int-h+mem[curbox+3].int;
      mem[curbox+3].int:=h;
      END;
    END;
  popnest;
  Boxend;
  END;
  {962}
PROCEDURE Newgraf(indented:boolean);
  BEGIN
  IF(curlist.modefield=1)OR(curlist.headfield<>curlist.tailfield)
  THEN
    BEGIN
    mem[curlist.tailfield].hh.rh:=newparamglue(2);
    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    END;
  pushnest;
  curlist.modefield:=93;
  curlist.auxfield:=1000;
  IF indented THEN
    BEGIN
    curlist.tailfield:=newnullbox;
    mem[curlist.headfield].hh.rh:=curlist.tailfield;
    mem[curlist.tailfield+1].int:=eqtb[4004].int;
    END;
  IF eqtb[2636].hh.rh<>0 THEN
    BEGIN
    IF curcmd<>41 THEN
      backinput;
    curcmd:=0;
    begintokenli(eqtb[2636].hh.rh,6);
    END;
  IF nestptr=1 THEN
    buildpage;
  END;
  {964}
PROCEDURE Indentinhmod;
  BEGIN
  IF curchr>0 THEN
    BEGIN
    BEGIN
    mem[curlist.tailfield].hh.rh:=
    newnullbox;
    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    END;
    mem[curlist.tailfield+1].int:=eqtb[4004].int;
    END;
  END;
  {966}
PROCEDURE Endgraf;
  BEGIN
  IF curlist.modefield=93 THEN
    BEGIN
    IF curlist.headfield=curlist.
    tailfield THEN
      popnest
    ELSE
      linebreak(eqtb[3588].int);
    IF eqtb[3602].int<>0 THEN
      eqworddefine(3602,0);
    IF eqtb[4021].int<>0 THEN
      eqworddefine(4021,0);
    IF eqtb[2634].hh.rh<>0 THEN
      eqdefine(2634,99,0);
    errorcount:=0;
    END;
  END;
  {969}
PROCEDURE Begininserto;
  BEGIN
  IF curlist.modefield<-1 THEN
    Reportillega
  ELSE
    BEGIN
    IF curcmd=38
    THEN
      curval:=255
    ELSE
      BEGIN
      scaneightbit;
      IF curval=255 THEN
	BEGIN
	printnl(767);
	BEGIN
	helpptr:=1;
	helpline[0]:=768;
	END;
	error;
	curval:=0;
	END;
      END;
    savestack[saveptr+0].int:=curval;
    saveptr:=saveptr+1;
    newsavelevel(13);
    scanleftbrac;
    pushnest;
    curlist.modefield:=-1;
    curlist.auxfield:=-65536000;
    END;
  END;
  {971}
PROCEDURE Makemark;
  VAR
    p:halfword;
  BEGIN
  IF curlist.modefield<-1 THEN
    Reportillega
  ELSE
    BEGIN
    p:=scantoks(
		false,true);
    p:=getnode(2);
    mem[p].hh.b0:=4;
    mem[p].hh.b1:=0;
    mem[p+1].int:=curval;
    mem[curlist.tailfield].hh.rh:=p;
    curlist.tailfield:=p;
    END;
  END;
  {973}
PROCEDURE Changeaux;
  BEGIN
  IF curchr<>Abs(curlist.modefield)THEN
    Reportillega
  ELSE
    IF curchr=
    1 THEN
      BEGIN
      scandimen(false,false,false);
      curlist.auxfield:=curval;
      END
    ELSE
      BEGIN
      scanint;
      IF(curval<0)OR(curval>65536)THEN
	BEGIN
	printnl(769);
	BEGIN
	helpptr:=1;
	helpline[0]:=770;
	END;
	interror(curval);
	END
      ELSE
	curlist.auxfield:=curval;
      END;
  END;
  {975}
PROCEDURE Appendpenalt;
  BEGIN
  scanint;
  BEGIN
  mem[curlist.tailfield].hh.rh:=newpenalty(curval);
  curlist.tailfield:=mem[curlist.tailfield].hh.rh;
  END;
  IF curlist.modefield=1 THEN
    buildpage;
  END;
  {977}
PROCEDURE Deleteskip;
  VAR
    p:halfword;
  BEGIN
  IF(curlist.modefield=1)AND(curlist.tailfield=curlist.headfield)
  THEN
    {978}
    BEGIN
    Youcant;
    BEGIN
    helpptr:=2;
    helpline[1]:=756;
    helpline[0]:=771;
    END;
    error;
    END
  ELSE
    BEGIN
    IF NOT(curlist.tailfield>12000)THEN
      IF mem[curlist.tailfield].hh.b0=9 THEN
	BEGIN
	p:=curlist.headfield;
	WHILE mem[p].hh.rh<>curlist.tailfield DO p:=mem[p].hh.rh;
	mem[p].hh.rh:=0;
	flushnodelis(curlist.tailfield);
	curlist.tailfield:=p;
	END;
    END;
  END;
  {980}
PROCEDURE Unpackage;
  VAR
    p:halfword;
  BEGIN
  scaneightbit;
  p:=eqtb[2637+curval].hh.rh;
  IF p<>0 THEN
    IF((Abs(curlist.modefield)=1)AND(mem[p].hh.b0=1))OR((Abs(
							     curlist.modefield)=93)AND(mem[p].hh.b0=0))THEN
      BEGIN
      mem[curlist.
	  tailfield].hh.rh:=mem[p+5].hh.rh;
      eqtb[2637+curval].hh.rh:=0;
      freenode(p,7);
      WHILE mem[curlist.tailfield].hh.rh<>0 DO curlist.tailfield:=mem[curlist.
								      tailfield].hh.rh;
      END
    ELSE
      BEGIN
      printnl(772);
      BEGIN
      helpptr:=2;
      helpline[1]:=773;
      helpline[0]:=774;
      END;
      error;
      END;
  END;
  {983}
PROCEDURE Appenditalic;
  VAR
    f:internalfont;
  BEGIN
  IF(curlist.tailfield>12000)AND(curlist.tailfield<>curlist.
				 headfield)THEN
    BEGIN
    f:=mem[curlist.tailfield].hh.b0;
    BEGIN
    mem[curlist.tailfield].hh.rh:=newkern(fontinfo[italicbase[f]+(
								  fontinfo[charbase[f]+mem[curlist.tailfield].hh.b1].qqqq.b2-0)DIV 4].int)
    ;
    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    END;
    END;
  END;
  {987}
PROCEDURE Appenddiscre;
  BEGIN
  BEGIN
  mem[curlist.tailfield].hh.rh:=newdisc;
  curlist.tailfield:=mem[curlist.tailfield].hh.rh;
  END;
  IF curchr=1 THEN
    mem[curlist.tailfield+1].hh.lh:=newcharacter(eqtb[2893].hh.rh,45)
  ELSE
    BEGIN
    saveptr:=saveptr+1;
    savestack[saveptr-1].int:=0;
    scanleftbrac;
    newsavelevel(12);
    pushnest;
    curlist.modefield:=-93;
    END;
  END;
  {989}
PROCEDURE Builddiscret;
  LABEL
    30,10;
  VAR
    p,q:halfword;
    n:integer;
  BEGIN
  unsave;
  {991}q:=curlist.headfield;
  p:=mem[q].hh.rh;
  n:=0;
  WHILE p<>0 DO
    BEGIN
    IF NOT(p>12000)THEN
      IF(mem[p].hh.b0<>10)AND(mem[p].hh.b0<>6)THEN
	BEGIN
	printnl(778);
	begindiagnos;
	showbox(p);
	enddiagnosti;
	BEGIN
	helpptr:=1;
	helpline[0]:=779;
	END;
	error;
	flushnodelis(p);
	mem[q].hh.rh:=0;
	GOTO 30;
	END;
    q:=p;
    p:=mem[q].hh.rh;
    n:=n+1;
    END;
  30:;
  p:=mem[curlist.headfield].hh.rh;
  popnest;
  CASE savestack[saveptr-1].int OF
    0:mem[curlist.tailfield+1].hh.lh:=p;
    1:mem[curlist.tailfield+1].hh.rh:=p;
    2:{990}BEGIN
      mem[curlist.tailfield].hh.rh:=p;
      IF n<128 THEN
	mem[curlist.tailfield].hh.b1:=n
      ELSE
	BEGIN
	printnl(775);
	BEGIN
	helpptr:=2;
	helpline[1]:=776;
	helpline[0]:=777;
	END;
	error;
	END;
      curlist.tailfield:=q;
      saveptr:=saveptr-1;
      GOTO 10;
      END;
    END;
  savestack[saveptr-1].int:=savestack[saveptr-1].int+1;
  scanleftbrac;
  newsavelevel(12);
  pushnest;
  curlist.modefield:=-93;
  10:
  END;
  {993}
PROCEDURE Insthe;
  BEGIN
  printnl(780);
  BEGIN
  helpptr:=3;
  helpline[2]:=781;
  helpline[1]:=782;
  helpline[0]:=783;
  END;
  backerror;
  mem[12013].hh.rh:=thetoks(false);
  begintokenli(curval,3);
  END;
  {996}
PROCEDURE Makeaccent;
  VAR
    s,t:real;
    p,q:halfword;
    f:internalfont;
    a,h,x,w,delta:scaled;
    i:fourquarters;
  BEGIN
  scancharnum;
  f:=eqtb[2893].hh.rh;
  p:=newcharacter(f,curval);
  IF p<>0 THEN
    BEGIN
    x:=fontinfo[5+parambase[f]].int;
    s:=fontinfo[1+parambase[f]].int/65536.0;
    a:=fontinfo[widthbase[f]+fontinfo[charbase[f]+mem[p].hh.b1].qqqq.b0].int;
    doassignment;
    {997}q:=0;
    f:=eqtb[2893].hh.rh;
    IF(curcmd=11)OR(curcmd=12)THEN
      q:=newcharacter(f,curchr)
    ELSE
      IF curcmd=16 THEN
	BEGIN
	scancharnum;
	q:=newcharacter(f,curval);
	END
      ELSE
	backinput;
    IF q<>0 THEN
      {998}
      BEGIN
      t:=fontinfo[1+parambase[f]].int/65536.0;
      i:=fontinfo[charbase[f]+mem[q].hh.b1].qqqq;
      w:=fontinfo[widthbase[f]+i.b0].int;
      h:=fontinfo[heightbase[f]+(i.b1-0)DIV 16].int;
      IF h<>x THEN
	BEGIN
	p:=hpack(p,0,1);
	mem[p+4].int:=x-h;
	END;
      delta:=Round((w-a)/2+h*t-x*s);
      mem[curlist.tailfield].hh.rh:=newkern(delta);
      mem[mem[curlist.tailfield].hh.rh].hh.rh:=p;
      mem[p].hh.rh:=newkern(-a-delta);
      curlist.tailfield:=mem[p].hh.rh;
      p:=q;
      END;
    mem[curlist.tailfield].hh.rh:=p;
    curlist.tailfield:=p;
    END;
  END;
  {1000}
PROCEDURE Alignerror;
  BEGIN
  IF Abs(alignstate)>2 THEN
    {1001}
    BEGIN
    printnl(788);
    BEGIN
    helpptr:=5;
    helpline[4]:=789;
    helpline[3]:=790;
    helpline[2]:=791;
    helpline[1]:=792;
    helpline[0]:=793;
    END;
    error;
    curcmd:=0;
    END
  ELSE
    BEGIN
    backinput;
    IF alignstate<0 THEN
      BEGIN
      printnl(436);
      curcmd:=1;
      alignstate:=alignstate+1;
      curtok:=379;
      END
    ELSE
      BEGIN
      printnl(784);
      curcmd:=2;
      alignstate:=alignstate-1;
      curtok:=637;
      END;
    BEGIN
    helpptr:=3;
    helpline[2]:=785;
    helpline[1]:=786;
    helpline[0]:=787;
    END;
    error;
    END;
  END;
  {1002}
PROCEDURE Noalignerror;
  BEGIN
  printnl(794);
  BEGIN
  helpptr:=2;
  helpline[1]:=795;
  helpline[0]:=796;
  END;
  error;
  END;
PROCEDURE Omiterror;
  BEGIN
  printnl(797);
  BEGIN
  helpptr:=2;
  helpline[1]:=798;
  helpline[0]:=796;
  END;
  error;
  END;

  {1005}
PROCEDURE Doendv;
  BEGIN
  IF curgroup=8 THEN
    BEGIN
    Endgraf;
    unsave;
    newsavelevel(8);
    IF fincol THEN
      finrow;
    END
  ELSE
    Offsave;
  END;
  {1008}
PROCEDURE Initmath;
  LABEL
    21,40,45,30,10;
  VAR
    w:scaled;
    l:scaled;
    s:scaled;
    p:halfword;
    q:halfword;
    f:internalfont;
    n:integer;
    v:scaled;
    d:scaled;
  BEGIN{1010}
  IF(fontparams[eqtb[2896].hh.rh]<22)
    OR(fontparams[eqtb[2912].hh.rh]<22)
    OR(fontparams[eqtb[2928].hh.rh]<22)
    OR(fontparams[eqtb[2897].hh.rh]<13)THEN
    BEGIN
    printnl(799);
    BEGIN
    helpptr:=4;
    helpline[3]:=800;
    helpline[2]:=801;
    helpline[1]:=802;
    helpline[0]:=803;
    END;
    error;
    GOTO 10;
    END;
  getnctoken;
  IF(curcmd=3)AND(curlist.modefield>0)THEN
    {1016}
    BEGIN
    IF curlist.headfield=curlist.tailfield THEN
      BEGIN
      popnest;
      w:=-134217727;
      END
    ELSE
      BEGIN
      linebreak(eqtb[3589].int);
      {1017}v:=
      mem[justbox+4].int+2*fontinfo[6+parambase[eqtb[2893].hh.rh]].int;
      w:=-134217727;
      p:=mem[justbox+5].hh.rh;
      WHILE p<>0 DO
	BEGIN{1018}
  21:
	IF(p>12000)THEN
	  BEGIN
	  f:=mem[p].hh.b0;
	  d:=fontinfo[widthbase[f]+fontinfo[charbase[f]+mem[p].hh.b1].qqqq.b0].int;
	  GOTO 40;
	  END;
	CASE mem[p].hh.b0 OF
	  0,1,2:BEGIN
	    d:=mem[p+1].int;
	    GOTO 40;
	    END;
	  6:{558}BEGIN
	    mem[12012]:=mem[p+1];
	    mem[12012].hh.rh:=mem[p].hh.rh;
	    p:=12012;
	    GOTO 21;
	    END;
	  10,11:d:=mem[p+1].int;
	  9:{1019}BEGIN
	    q:=mem[p+1].hh.lh;
	    d:=mem[q+1].int;
	    IF((mem[justbox+5].hh.b0=1)AND(mem[justbox+5].hh.b1=mem[q].hh.b0))
	      OR((mem[justbox+5].hh.b0=2)AND(mem[justbox+5].hh.b1=mem[q].hh.b1))
	    THEN
	      v:=134217727;
	    IF mem[p].hh.b1>=100 THEN
	      GOTO 40;
	    END;
	  8:{1218}d:=0;
	  OTHERS:d:=0
	  END;
	IF v<134217727 THEN
	  v:=v+d;
	GOTO 45;
  40:
	IF v<134217727 THEN
	  BEGIN
	  v:=v+d;
	  w:=v;
	  END
	ELSE
	  BEGIN
	  w:=134217727;
	  GOTO 30;
	  END;
  45:
	p:=mem[p].hh.rh;
	END;
  30:;
      END;
    {1020}
    IF eqtb[2634].hh.rh=0 THEN
      IF(eqtb[4021].int<>0)
	AND(((eqtb[3619].int>=0)AND(curlist.alreadyfield+2>eqtb[3619].int))
	    OR(curlist.alreadyfield+1<-eqtb[3619].int))THEN
	BEGIN
	l:=eqtb[4008].int-Abs(eqtb[4021].int);
	IF eqtb[4021].int>0 THEN
	  s:=eqtb[4021].int
	ELSE
	  s:=0;
	END
      ELSE
	BEGIN
	l:=eqtb[4008].int;
	s:=0;
	END
    ELSE
      BEGIN
      n:=mem[eqtb[2634].hh.rh].hh.lh;
      IF curlist.alreadyfield+2>=n THEN
	p:=eqtb[2634].hh.rh+2*n
      ELSE
	p:=eqtb[2634].hh.rh+2*(curlist.alreadyfield+2);
      s:=mem[p-1].int;
      l:=mem[p].int;
      END;
    pushnest;
    curlist.modefield:=185;
    curlist.auxfield:=0;
    newsavelevel(16);
    eqdefine(2942,101,1);
    eqworddefine(2374,w);
    eqworddefine(2375,l);
    eqworddefine(2376,s);
    IF curlist.modefield=1 THEN
      buildpage;
    END
  ELSE
    BEGIN
    backinput;
    {1009}
    BEGIN
    pushnest;
    curlist.modefield:=-185;
    curlist.auxfield:=0;
    newsavelevel(16);
    eqdefine(2942,101,1);
    END;
    END;
  10:
  END;
  {1013}
PROCEDURE Starteqno;
  BEGIN
  IF curgroup=16 THEN
    BEGIN
    savestack[saveptr+0].int:=curchr;
    saveptr:=saveptr+1;
    {1009}
    BEGIN
    pushnest;
    curlist.modefield:=-185;
    curlist.auxfield:=0;
    newsavelevel(16);
    eqdefine(2942,101,1);
    END;
    END
  ELSE
    Offsave;
  END;
  {1022}
PROCEDURE Scanmath(p:halfword);
  LABEL
    10;
  VAR
    c:integer;
  BEGIN{362}
  REPEAT
    getnctoken;
  UNTIL curcmd<>10;
  CASE curcmd OF
    11,12:c:=eqtb[3071+curchr].hh.rh;
    16:BEGIN
      scancharnum;
      c:=curval+28672;
      END;
    17:BEGIN
      scanfifteenb;
      c:=curval;
      END;
    15:BEGIN
      scantwentyse;
      c:=curval DIV 4096;
      END;
    OTHERS:{1023}BEGIN
      backinput;
      scanleftbrac;
      savestack[saveptr+0].int:=p;
      saveptr:=saveptr+1;
      newsavelevel(11);
      pushnest;
      curlist.auxfield:=0;
      END
    END;
  mem[p].hh.rh:=1;
  mem[p].hh.b1:=c MOD 256;
  IF c>=28672 THEN
    mem[p].hh.b0:=eqtb[2942].hh.rh
  ELSE
    mem[p].hh.b0:=(cdiv 256)MOD 16;
  GOTO 10;
  10:
  END;
  {1025}
PROCEDURE Setmathchar(c:integer);
  VAR
    p:halfword;
  BEGIN
  p:=newnoad;
  mem[p+1].hh.rh:=1;
  mem[p+1].hh.b1:=c MOD 256;
  IF c>=28672 THEN
    BEGIN
    mem[p+1].hh.b0:=eqtb[2942].hh.rh;
    mem[p].hh.b0:=15;
    END
  ELSE
    BEGIN
    mem[p+1].hh.b0:=(c DIV 256)MOD 16;
    mem[p].hh.b0:=15+(c DIV 4096);
    END;
  mem[curlist.tailfield].hh.rh:=p;
  curlist.tailfield:=p;
  END;
  {1029}
PROCEDURE Mathlimitswi;
  LABEL
    10;
  BEGIN
  IF curlist.headfield<>curlist.tailfield THEN
    IF mem[curlist.tailfield].hh.b0=16 THEN
      BEGIN
      mem[curlist.tailfield].hh.b1:=1-mem[curlist.tailfield].hh.b1;
      GOTO 10;
      END;
  printnl(806);
  BEGIN
  helpptr:=1;
  helpline[0]:=807;
  END;
  10:
  END;
  {1030}
PROCEDURE Scandelimite(p:halfword;
		       r:boolean);
  BEGIN
  IF r THEN
    scantwentyse
  ELSE
    BEGIN{362}
    REPEAT
      getnctoken;
    UNTIL curcmd<>10;
    CASE curcmd OF
      11,12:curval:=eqtb[3876+curchr].int;
      15:scantwentyse;
      OTHERS:curval:=-1
      END;
    END;
  IF curval<0 THEN
    {1031}
    BEGIN
    printnl(808);
    BEGIN
    helpptr:=6;
    helpline[5]:=809;
    helpline[4]:=810;
    helpline[3]:=811;
    helpline[2]:=812;
    helpline[1]:=813;
    helpline[0]:=814;
    END;
    backerror;
    curval:=0;
    END;
  mem[p].qqqq.b0:=(curval DIV 1048576)MOD 16;
  mem[p].qqqq.b1:=(curval DIV 4096)MOD 256;
  mem[p].qqqq.b2:=(curval DIV 256)MOD 16;
  mem[p].qqqq.b3:=curval MOD 256;
  END;
  {1033}
PROCEDURE Mathradical;
  BEGIN
  BEGIN
  mem[curlist.tailfield].hh.rh:=getnode(5);
  curlist.tailfield:=mem[curlist.tailfield].hh.rh;
  END;
  mem[curlist.tailfield].hh.b0:=23;
  mem[curlist.tailfield].hh.b1:=0;
  mem[curlist.tailfield+1].hh:=emptyfield;
  mem[curlist.tailfield+3].hh:=emptyfield;
  mem[curlist.tailfield+2].hh:=emptyfield;
  Scandelimite(curlist.tailfield+4,true);
  Scanmath(curlist.tailfield+1);
  END;
  {1035}
PROCEDURE Mathac;
  BEGIN
  BEGIN
  mem[curlist.tailfield].hh.rh:=getnode(5);
  curlist.tailfield:=mem[curlist.tailfield].hh.rh;
  END;
  mem[curlist.tailfield].hh.b0:=27;
  mem[curlist.tailfield].hh.b1:=0;
  mem[curlist.tailfield+1].hh:=emptyfield;
  mem[curlist.tailfield+3].hh:=emptyfield;
  mem[curlist.tailfield+2].hh:=emptyfield;
  mem[curlist.tailfield+4].hh.rh:=1;
  scanfifteenb;
  mem[curlist.tailfield+4].hh.b1:=curval MOD 256;
  IF curval>=28672 THEN
    mem[curlist.tailfield+4].hh.b0:=eqtb[2942].hh.rh
  ELSE
    mem[curlist.tailfield+4].hh.b0:=(curval DIV 256)MOD 16;
  Scanmath(curlist.tailfield+1);
  END;
  {1041}
PROCEDURE Mathnonscrip;
  BEGIN{362}
  REPEAT
    getnctoken;
  UNTIL curcmd<>10;
  IF(curcmd>30)OR(curcmd<26)THEN
    BEGIN
    printnl(815);
    BEGIN
    helpptr:=2;
    helpline[1]:=816;
    helpline[0]:=817;
    END;
    backerror;
    END
  ELSE
    BEGIN
    backinput;
    BEGIN
    mem[curlist.tailfield].hh.rh:=newglue(0);
    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    END;
    deletegluere(0);
    mem[curlist.tailfield].hh.b1:=99;
    END;
  END;
  {1043}
PROCEDURE Subsup;
  VAR
    t:smallnumber;
    p:halfword;
  BEGIN
  t:=0;
  p:=0;
  IF curlist.tailfield<>curlist.headfield
  THEN
    IF(mem[curlist.tailfield].hh.b0>=15)
      AND(mem[curlist.tailfield].hh.b0<29)THEN
      BEGIN
      p:=curlist.tailfield+2+curcmd-7;
      t:=mem[p].hh.rh;
      END;
  IF(p=0)OR(t<>0)THEN
    {1044}
    BEGIN
    BEGIN
    mem[curlist.tailfield].hh.rh:=newnoad;
    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    END;
    mem[curlist.tailfield].hh.b0:=15;
    p:=curlist.tailfield+2+curcmd-7;
    IF t<>0 THEN
      BEGIN
      IF curcmd=7 THEN
	BEGIN
	printnl(818);
	BEGIN
	helpptr:=1;
	helpline[0]:=819;
	END;
	END
      ELSE
	BEGIN
	printnl(820);
	BEGIN
	helpptr:=1;
	helpline[0]:=821;
	END;
	END;
      error;
      END;
    END;
  Scanmath(p);
  END;
  {1048}
PROCEDURE Mathfraction;
  VAR
    c:smallnumber;
  BEGIN
  c:=curchr;
  IF curlist.auxfield<>0 THEN
    {1050}
    BEGIN
    IF c MOD 3=0 THEN
      scandimen(false,false,false);
    IF c>=3 THEN
      BEGIN
      Scandelimite(12013,false);
      Scandelimite(12013,false);
      END;
    printnl(827);
    BEGIN
    helpptr:=3;
    helpline[2]:=828;
    helpline[1]:=829;
    helpline[0]:=830;
    END;
    error;
    END
  ELSE
    BEGIN
    curlist.auxfield:=getnode(6);
    mem[curlist.auxfield].hh.b0:=24;
    mem[curlist.auxfield].hh.b1:=0;
    mem[curlist.auxfield+2].hh.rh:=3;
    mem[curlist.auxfield+2].hh.lh:=mem[curlist.headfield].hh.rh;
    mem[curlist.auxfield+3].hh:=emptyfield;
    mem[curlist.auxfield+4].qqqq:=nullcharacte;
    mem[curlist.auxfield+5].qqqq:=nullcharacte;
    mem[curlist.headfield].hh.rh:=0;
    curlist.tailfield:=curlist.headfield;
    {1049}
    CASE c MOD 3 OF
      0:BEGIN
	scandimen(false,false,false);
	mem[curlist.auxfield+1].int:=curval;
	END;
      1:mem[curlist.auxfield+1].int:=1073741824;
      2:mem[curlist.auxfield+1].int:=0;
      END;
    IF c>=3 THEN
      BEGIN
      Scandelimite(curlist.auxfield+4,false);
      Scandelimite(curlist.auxfield+5,false);
      END;
    END;
  END;
  {1051}
FUNCTION Finmlist(p:halfword):halfword;
  VAR
    q:halfword;
  BEGIN
  IF curlist.auxfield<>0 THEN
    {1052}
    BEGIN
    mem[curlist.auxfield+3].hh.rh:=3;
    mem[curlist.auxfield+3].hh.lh:=mem[curlist.headfield].hh.rh;
    IF p=0 THEN
      q:=curlist.auxfield
    ELSE
      BEGIN
      q:=mem[curlist.auxfield+2].hh.lh;
      IF mem[q].hh.b0<>29 THEN
	confusion(608);
      mem[curlist.auxfield+2].hh.lh:=mem[q].hh.rh;
      mem[q].hh.rh:=curlist.auxfield;
      mem[curlist.auxfield].hh.rh:=p;
      END;
    END
  ELSE
    BEGIN
    mem[curlist.tailfield].hh.rh:=p;
    q:=mem[curlist.headfield].hh.rh;
    END;
  popnest;
  Finmlist:=q;
  END;
  {1057}
PROCEDURE Mathleftrigh;
  VAR
    t:smallnumber;
    p:halfword;
  BEGIN
  t:=curchr;
  IF(t=30)AND(curgroup<>17)THEN
    {1058}
    BEGIN
    IF curgroup=16 THEN
      BEGIN
      Scandelimite(12013,false);
      printnl(831);
      BEGIN
      helpptr:=1;
      helpline[0]:=832;
      END;
      error;
      END
    ELSE
      Offsave;
    END
  ELSE
    BEGIN
    p:=newnoad;
    mem[p].hh.b0:=t;
    Scandelimite(p+1,false);
    IF t=29 THEN
      BEGIN
      pushnest;
      newsavelevel(17);
      mem[curlist.headfield].hh.rh:=p;
      curlist.tailfield:=p;
      END
    ELSE
      BEGIN
      p:=Finmlist(p);
      unsave;
      BEGIN
      mem[curlist.tailfield].hh.rh:=newnoad;
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
      mem[curlist.tailfield+1].hh.rh:=3;
      mem[curlist.tailfield+1].hh.lh:=p;
      END;
    END;
  END;
  {1060}
PROCEDURE Finmath;
  VAR
    l:boolean;
    m:integer;
    p:halfword;
    a:halfword;
    {1063}b:halfword;
    w:scaled;
    z:scaled;
    e:scaled;
    q:scaled;
    d:scaled;
    s:scaled;
    g1,g2:smallnumber;
    r:halfword;
  BEGIN
  m:=curlist.modefield;
  l:=false;
  p:=Finmlist(0);
  IF curlist.modefield=-m THEN
    BEGIN
    a:=hpack(mlisttohlist(p,2,false),0,1);
    unsave;saveptr:=saveptr-1;
    IF savestack[saveptr+0].int=1 THEN
      l:=true;
    m:=curlist.modefield;
    p:=Finmlist(0);
    END
  ELSE
    a:=0;
  IF m<0 THEN
    {1061}
    BEGIN
    BEGIN
    mem[curlist.tailfield].hh.rh:=newmath(eqtb[4005].int,0);
    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    END;
    mem[curlist.tailfield].hh.rh:=mlisttohlist(p,2,true);
    WHILE mem[curlist.tailfield].hh.rh<>0
    DO curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    BEGIN
    mem[curlist.tailfield].hh.rh:=newmath(eqtb[4005].int,1);
    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    END;
    curlist.auxfield:=1000;
    unsave;
    END
  ELSE
    BEGIN{1062}
    BEGIN
    getnctoken;
    IF curcmd<>3 THEN
      BEGIN
      printnl(833);
      BEGIN
      helpptr:=2;
      helpline[1]:=834;
      helpline[0]:=835;
      END;
      backerror;
      END;
    END;
    {1064}p:=mlisttohlist(p,0,false);
    b:=hpack(p,0,1);
    w:=mem[b+1].int;
    z:=eqtb[4018].int;
    s:=eqtb[4019].int;
    IF a=0 THEN
      BEGIN
      e:=0;
      q:=0;
      END
    ELSE
      BEGIN
      e:=mem[a+1].int;
      q:=e+fontinfo[6+parambase[eqtb[2896].hh.rh]].int;
      END;
    IF w+q>z THEN
      {1066}
      BEGIN
      IF(e<>0)AND((w-totalshrink[0]+q<=z)OR(totalshrink[1]<>0)
		  OR(totalshrink[2]<>0)OR(totalshrink[3]<>0))THEN
	BEGIN
	freenode(b,7);
	b:=hpack(p,z-q,0);
	END
      ELSE
	BEGIN
	e:=0;
	IF w>z THEN
	  BEGIN
	  freenode(b,7);
	  b:=hpack(p,z,0);
	  END;
	END;
      w:=mem[b+1].int;
      END;
    {1067}d:=half(z-w);
    IF(e>0)AND(d<2*e)THEN
      BEGIN
      d:=half(z-w-e);
      IF p<>0 THEN
	IF mem[p].hh.b0=9 THEN
	  d:=0;
      END;
    {1068}
    BEGIN
    mem[curlist.tailfield].hh.rh:=newpenalty(eqtb[3594].int);
    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    END;
    IF(d+s<=eqtb[4017].int)OR l THEN
      BEGIN
      g1:=3;
      g2:=3;
      END
    ELSE
      BEGIN
      g1:=4;
      g2:=5;
      END;
    IF l AND(e=0)THEN
      BEGIN
      mem[a+4].int:=s;
      appendtovlis(a);
      BEGIN
      mem[curlist.tailfield].hh.rh:=newpenalty(10000);
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
      END
    ELSE
      BEGIN
      mem[curlist.tailfield].hh.rh:=newparamglue(g1);
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
    {1069}
    IF e<>0 THEN
      BEGIN
      p:=newkern(z-w-e-d);
      IF l THEN
	BEGIN
	mem[a].hh.rh:=r;
	mem[r].hh.rh:=b;
	b:=a;
	d:=0;
	END
      ELSE
	BEGIN
	mem[b].hh.rh:=r;
	mem[r].hh.rh:=a;
	END;
      END;
    mem[b+4].int:=s+d;
    appendtovlis(b);
    {1070}
    IF(a<>0)AND(e=0)AND NOT l THEN
      BEGIN
      BEGIN
      mem[curlist.tailfield].hh.rh:=newpenalty(10000);
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
      mem[a+4].int:=s+z-mem[a+1].int;
      appendtovlis(a);
      BEGIN
      mem[curlist.tailfield].hh.rh:=newpenalty(eqtb[3593].int);
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
      END
    ELSE
      BEGIN
      BEGIN
      mem[curlist.tailfield].hh.rh:=newpenalty(eqtb[3593].int);
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
      BEGIN
      mem[curlist.tailfield].hh.rh:=newparamglue(g2);
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
      END;
    resumeafterd;
    END;
  END;

  {1065}
PROCEDURE Resumeafterd;
  BEGIN
  IF curgroup<>16 THEN
    confusion(836);
  unsave;
  curlist.alreadyfield:=curlist.alreadyfield+3;
  pushnest;
  curlist.modefield:=93;
  curlist.auxfield:=1000;
  {365}
  BEGIN
  getnctoken;
  IF curcmd<>10 THEN
    backinput;
  END;
  IF nestptr=1 THEN
    buildpage;
  END;
  {1076}
PROCEDURE Conditional;
  LABEL
    10;
  VAR
    b:boolean;
    r:60..62;
    n:integer;
    c:1..2;
    p,q:halfword;
  BEGIN
  CASE curchr OF
    0:{1080}BEGIN{362}
      REPEAT
	getnctoken;
      UNTIL curcmd<>10;
      IF(curtok>=3328)OR(curcmd=9)THEN
	n:=256
      ELSE
	BEGIN
	n:=curchr;
	{362}
	REPEAT
	  getnctoken;
	UNTIL curcmd<>10;
	IF(curtok>=3328)OR(curcmd=9)THEN
	  n:=256;
	END;
      IF n<256 THEN
	b:=(n=curchr)
      ELSE
	BEGIN
	printnl(851);
	BEGIN
	helpptr:=2;
	helpline[1]:=852;
	helpline[0]:=853;
	END;
	backerror;
	GOTO 10;
	END;
      END;
    1,2:{1077}BEGIN
      c:=curchr;
      IF c=1 THEN
	scanint
      ELSE
	scandimen(false,false,false);
      n:=curval;
      {362}
      REPEAT
	getnctoken;
      UNTIL curcmd<>10;
      IF(curtok>=3132)AND(curtok<=3134)THEN
	r:=curtok-3072
      ELSE
	BEGIN
	printnl(849);
	printcmdchr(55,c);
	BEGIN
	helpptr:=1;
	helpline[0]:=850;
	END;
	backerror;
	r:=61;
	END;
      IF c=1 THEN
	scanint
      ELSE
	scandimen(false,false,false);
      CASE r OF
	60:b:=(n<curval);
	61:b:=(n=curval);
	62:b:=(n>curval);
	END;
      END;
    3:{1078}BEGIN
      scaneightbit;
      b:=NOT Odd(eqtb[3620+curval].int);
      END;
    4:b:=(Abs(curlist.modefield)=1);
    5:b:=(Abs(curlist.modefield)=93);
    6:b:=(Abs(curlist.modefield)=185);
    7:b:=(curlist.modefield<0);
    8:{1079}BEGIN
      scaneightbit;
      b:=(eqtb[2637+curval].hh.rh=0);
      END;
    9:{1081}BEGIN
      gettoken;
      n:=csptr;
      IF n<>0 THEN
	gettoken;
      IF csptr<>0 THEN
	BEGIN
	IF curcmd<>eqtb[n].hh.b0 THEN
	  b:=false
	ELSE
	  IF curcmd<94 THEN
	    b:=(curchr=eqtb[n].hh.rh)
	  ELSE
	    {1082}
	    BEGIN
	    p:=mem[curcmd].hh.rh;
	    q:=mem[eqtb[n].hh.rh].hh.rh;
	    WHILE(p<>0)AND(q<>0)DO
	      IF mem[p].hh.lh<>mem[q].hh.lh THEN
		p:=0
	      ELSE
		BEGIN
		p:=mem[p].hh.rh;
		q:=mem[q].hh.rh;
		END;
	    b:=((p=0)AND(q=0));
	    END;
	END
      ELSE
	BEGIN
	printnl(854);
	BEGIN
	helpptr:=2;
	helpline[1]:=855;
	helpline[0]:=853;
	END;
	backerror;
	GOTO 10;
	END;
      END;
    END;
  {1083}
  IF b THEN
    BEGIN
    scanleftbrac;
    newsavelevel(5);
    curlevel:=curlevel-1;
    END
  ELSE
    BEGIN
    passblock(0);
    {362}
    REPEAT
      getnctoken;
    UNTIL curcmd<>10;
    IF curcmd=57 THEN
      BEGIN
      scanleftbrac;
      newsavelevel(6);
      curlevel:=curlevel-1;
      END
    ELSE
      BEGIN
      printnl(856);
      BEGIN
      helpptr:=3;
      helpline[2]:=857;
      helpline[1]:=858;
      helpline[0]:=859;
      END;
      backerror;
      END;
    END;
  10:
  END;
  {1086}
PROCEDURE Spuriouselse;
  BEGIN
  printnl(861);
  BEGIN
  helpptr:=2;
  helpline[1]:=862;
  helpline[0]:=863;
  END;
  error;
  END;
  {1087}
PROCEDURE Caseconditio;
  LABEL
    10,30;
  VAR
    n:integer;
  BEGIN
  scanint;
  n:=curval;
  WHILE n<>0 DO
    BEGIN{362}
    REPEAT
      getnctoken;
    UNTIL curcmd<>10;
    IF curcmd<>1 THEN
      IF curcmd=57 THEN
	GOTO 30
      ELSE
	{1089}
	BEGIN
	printnl(864);
	BEGIN
	helpptr:=3;
	helpline[2]:=865;
	helpline[1]:=866;
	helpline[0]:=859;
	END;
	backerror;
	GOTO 10;
	END;
    passblock(1);
    n:=n-1;
    END;
  30:
  scanleftbrac;
  IF n=0 THEN
    newsavelevel(7)
  ELSE
    newsavelevel(6);
  curlevel:=curlevel-1;
  10:
  END;
  {1093}{1125}
PROCEDURE Newfont;
  LABEL
    21,10;
  VAR
    u:0..badfontcode;
    s:scaled;
    n:strnumber;
    f:internalfont;
  BEGIN
  scanfontnumb;
  u:=curval;
  scanoptional;
  21:
  scanfilename;
  {1126}
  IF scankeyword(928)THEN
    BEGIN
    scandimen(false,false,false);
    s:=curval;
    IF(s<=0)OR(s>=134217728)THEN
      BEGIN
      printnl(929);
      BEGIN
      helpptr:=2;
      helpline[1]:=930;
      helpline[0]:=931;
      END;
      error;
      s:=10*65536;
      END;
    END
  ELSE
    s:=0;
  IF u=badfontcode THEN
    GOTO 10;
  {1127}
  IF fontnumber[u]<>0 THEN
    BEGIN
    f:=fontnumber[u];
    IF((s=0)AND fontscaled[f])OR((s<>0)AND(s<>fontsize[f]))
      OR NOT streqstr(fontname[f],curname)
      OR NOT streqstr(fontarea[f],curarea)THEN
      {1128}
      BEGIN
      printnl(543);
      printint(u);
      print(932);
      print(fontname[f]);
      IF fontscaled[f]THEN
	BEGIN
	print(544);
	printscaled(fontsize[f]);
	print(482);
	END;
      BEGIN
      helpptr:=2;
      helpline[1]:=933;
      helpline[0]:=934;
      END;
      error;
      END;
    GOTO 10;
    END;
  {1129}
  FOR f:=1 TO fontptr DO
    IF streqstr(fontname[f],curname)AND
      streqstr(fontarea[f],curarea)AND((s=0)
				       AND NOT fontscaled[f])OR((s<>0)AND(s=fontsize[f]))THEN
      BEGIN
      fontnumber[u]:=f;
      fontcode[f]:=u;
      GOTO 10;
      END;
  ;
  readfontinfo(u,curname,curarea,s);
  10:
  END;
  {1133}
PROCEDURE Newinteracti;
  BEGIN
  println;
  interaction:=curchr;
  {71}
  IF interaction=0 THEN
    selector:=16
  ELSE
    selector:=17;
  IF jobname<>0 THEN
    selector:=selector+2;
  END;
PROCEDURE Prefixedcomm;
  LABEL
    10;
  VAR
    a:smallnumber;
    j:halfword;
    k:0..fontmemsize;
    p,q,r:halfword;
    n:integer;
    e:boolean;
  BEGIN
  a:=0;
  WHILE curcmd=80 DO
    BEGIN
    IF NOT Odd(a DIV curchr)THEN
      a:=a+curchr;
    {362}
    REPEAT
      getnctoken;
    UNTIL curcmd<>10;
    IF curcmd<80 THEN
      {1094}
      BEGIN
      printnl(875);
      printcmdchr(curcmd,curchr);
      printchar(39);
      BEGIN
      helpptr:=1;
      helpline[0]:=876;
      END;
      backerror;
      GOTO 10;
      END;
    END;
  {1095}
  IF(curcmd<>82)AND(a MOD 4<>0)THEN
    BEGIN
    printnl(877);
    printcmdchr(curcmd,curchr);
    printchar(39);
    BEGIN
    helpptr:=1;
    helpline[0]:=878;
    END;
    error;
    END;
  CASE curcmd OF
    {1097}78:BEGIN
      scanfontnumb;
      IF(a>=4)THEN
	geqdefine(2893,101,curval)
      ELSE
	eqdefine(2893,101,curval);
      END;
    79:BEGIN
      scanfourbiti;
      IF(a>=4)THEN
	geqdefine(2942,101,curval)
      ELSE
	eqdefine(2942,101,curval);
      END;
    {1098}82:BEGIN
      IF Odd(curchr)AND NOT(a>=4)THEN
	a:=a+4;
      e:=(curchr>=2);
      gettoken;
      IF curtok<4096 THEN
	{1099}
	BEGIN
	printnl(879);
	BEGIN
	helpptr:=4;
	helpline[3]:=880;
	helpline[2]:=881;
	helpline[1]:=882;
	helpline[0]:=883;
	END;
	backerror;
	END
      ELSE
	BEGIN
	p:=csptr;
	q:=scantoks(true,e);
	IF(a>=4)THEN
	  geqdefine(p,94+(a MOD 4),curval)
	ELSE
	  eqdefine(p,94+(a MOD 4
			 ),curval);
	END;
      END;
    {1100}81:BEGIN
      e:=true;
      {1101}gettoken;
      IF csptr<>0 THEN
	BEGIN
	p:=csptr;
	REPEAT
	  gettoken;
	UNTIL(curcmd<>10)AND(curtok<>3133);
	IF curtok>=4096 THEN
	  BEGIN
	  e:=false;
	  IF curcmd>=94 THEN
	    mem[curchr].hh.lh:=mem[curchr].hh.lh+1;
	  IF(a>=4)THEN
	    geqdefine(p,curcmd,curchr)
	  ELSE
	    eqdefine(p,curcmd,curchr);
	  END;
	END;
      IF e THEN
	BEGIN
	printnl(884);
	BEGIN
	helpptr:=2;
	helpline[1]:=885;
	helpline[0]:=886;
	END;
	backerror;
	END;
      END;
    {1102}70:BEGIN
      p:=curchr;
      scanoptional;
      q:=scantoks(false,false);
      IF mem[curval].hh.rh=0 THEN
	IF(a>=4)THEN
	  geqdefine(p,92,0)
	ELSE
	  eqdefine(p,92,0)
      ELSE
	BEGIN
	IF p=2635 THEN
	  BEGIN
	  mem[q].hh.rh:=getavail;
	  q:=mem[q].hh.rh;
	  mem[q].hh.lh:=637;
	  q:=getavail;
	  mem[q].hh.lh:=379;
	  mem[q].hh.rh:=mem[curval].hh.rh;
	  mem[curval].hh.rh:=q;
	  END;
	IF(a>=4)THEN
	  geqdefine(p,94,curval)
	ELSE
	  eqdefine(p,94,curval);
	END;
      END;
    {1103}71:BEGIN
      p:=curchr;
      scanoptional;
      scanint;
      IF(a>=4)THEN
	geqworddefin(3583+p,curval)
      ELSE
	eqworddefine(3583+p,curval);
      END;
    72:BEGIN
      p:=curchr;
      scanoptional;
      scandimen(false,false,false);
      IF(a>=4)THEN
	geqworddefin(4004+p,curval)
      ELSE
	eqworddefine(4004+p,curval)
	;
      END;
    73:BEGIN
      p:=curchr;
      scanoptional;
      scanglue(p>=14);
      IF(mem[curval+1].int=0)AND(mem[curval+2].int=0)AND(mem[curval+3].int=0)
      THEN
	BEGIN
	mem[0].hh.rh:=mem[0].hh.rh+1;
	deletegluere(curval);
	curval:=0;
	END;
      IF(a>=4)THEN
	geqdefine(2361+p,98,curval)
      ELSE
	eqdefine(2361+p,98,curval);
      END;
    {1104}75:BEGIN
      scanoptional;
      scandimen(false,false,false);
      IF(a>=4)THEN
	geqworddefin(4021,curval)
      ELSE
	eqworddefine(4021,curval);
      n:=1;
      IF scankeyword(887)THEN
	BEGIN
	scanint;
	n:=curval;
	END
      ELSE
	IF scankeyword(888)THEN
	  BEGIN
	  scanint;
	  n:=-curval;
	  IF n=0 THEN
	    eqtb[4021].int:=0;
	  END
	ELSE
	  n:=1;
      IF(a>=4)THEN
	geqworddefin(3619,n)
      ELSE
	eqworddefine(3619,n);
      END;
    {1107}76:BEGIN{1108}
      IF curchr=2943 THEN
	n:=15
      ELSE
	IF curchr=3071 THEN
	  n
	  :=32767
	ELSE
	  IF curchr=3455 THEN
	    n:=65536
	  ELSE
	    IF curchr=3876 THEN
	      n:=
	      16777215
	    ELSE
	      n:=127;
      p:=curchr;
      scansevenbit;
      p:=p+curval;
      scanoptional;
      scanint;
      IF((curval<0)AND(p<3876))OR(curval>n)THEN
	BEGIN
	printnl(895);
	printint(curval);
	IF p<3876 THEN
	  print(896)
	ELSE
	  print(897);
	printint(n);
	BEGIN
	helpptr:=1;
	helpline[0]:=898;
	END;
	error;
	curval:=0;
	END;
      IF p<3876 THEN
	IF(a>=4)THEN
	  geqdefine(p,101,curval)
	ELSE
	  eqdefine(p,101,
		   curval)
      ELSE
	IF(a>=4)THEN
	  geqworddefin(p,curval)
	ELSE
	  eqworddefine(p,
		       curval);
      END;
    {1109}77:BEGIN
      p:=curchr;
      scanfourbiti;
      p:=p+curval;
      scanoptional;
      scanint;
      IF(curval>=badfontcode)OR(curval<0)THEN
	n:=0
      ELSE
	n:=fontnumber[curval];
      IF n=0 THEN
	BEGIN
	printnl(899);
	printint(curval);
	print(900);
	BEGIN
	helpptr:=1;
	helpline[0]:=901;
	END;
	error;
	END
      ELSE
	IF(a>=4)THEN
	  geqdefine(p,101,n)
	ELSE
	  eqdefine(p,101,n);
      END;
    {1112}84,85,86,87:BEGIN
      p:=curchr;
      q:=curcmd;
      scaneightbit;
      n:=curval;
      IF q=84 THEN
	scanoptional
      ELSE
	{1113}
	IF NOT scankeyword(921)THEN
	  BEGIN
	  printnl(922);
	  BEGIN
	  helpptr:=2;
	  helpline[1]:=923;
	  helpline[0]:=924;
	  END;
	  error;
	  GOTO 10;
	  END;
      aritherror:=false;
      IF q<86 THEN
	{1114}
	CASE p OF
	  0:BEGIN
	    scanint;
	    IF q=85 THEN
	      curval:=curval+eqtb[3620+n].int;
	    END;
	  1:BEGIN
	    scandimen(false,false,false);
	    IF q=85 THEN
	      curval:=curval+eqtb[4022+n].int;
	    END;
	  2:BEGIN
	    scanglue(false);
	    IF q=85 THEN
	      {1115}
	      BEGIN
	      q:=newspec(curval);
	      r:=eqtb[2378+n].hh.rh;
	      deletegluere(curval);
	      mem[q+1].int:=mem[q+1].int+mem[r+1].int;
	      IF mem[q+2].int=0 THEN
		mem[q].hh.b0:=0;
	      IF mem[q].hh.b0=mem[r].hh.b0 THEN
		mem[q+2].int:=mem[q+2].int+mem[r+2].
		int
	      ELSE
		IF(mem[q].hh.b0<mem[r].hh.b0)AND(mem[r+2].int<>0)THEN
		  BEGIN
		  mem
		  [q+2].int:=mem[r+2].int;
		  mem[q].hh.b0:=mem[r].hh.b0;
		  END;
	      IF mem[q+3].int=0 THEN
		mem[q].hh.b1:=0;
	      IF mem[q].hh.b1=mem[r].hh.b1 THEN
		mem[q+3].int:=mem[q+3].int+mem[r+3].
		int
	      ELSE
		IF(mem[q].hh.b1<mem[r].hh.b1)AND(mem[r+3].int<>0)THEN
		  BEGIN
		  mem
		  [q+3].int:=mem[r+3].int;
		  mem[q].hh.b1:=mem[r].hh.b1;
		  END;
	      END;
	    END;
	  END
      ELSE
	{1116}
	BEGIN
	scanint;
	CASE p OF
	  0:IF q=86 THEN
	      curval:=nxplusy(eqtb[3620+n].int,curval,0)
	    ELSE
	      curval:=xovern(eqtb[3620+n].int,curval);
	  1:IF q=86 THEN
	      curval:=nxplusy(eqtb[4022+n].int,curval,0)
	    ELSE
	      curval:=
	      xovern(eqtb[4022+n].int,curval);
	  2:BEGIN
	    r:=newspec(eqtb[2378+n].hh.rh);
	    IF q=86 THEN
	      BEGIN
	      mem[r+1].int:=nxplusy(mem[eqtb[2378+n].hh.rh+1].int,
				    curval,0);
	      mem[r+2].int:=nxplusy(mem[eqtb[2378+n].hh.rh+2].int,curval,0);
	      mem[r+3].int:=nxplusy(mem[eqtb[2378+n].hh.rh+3].int,curval,0);
	      END
	    ELSE
	      BEGIN
	      mem[r+1].int:=xovern(mem[eqtb[2378+n].hh.rh+1].int,curval
				   );
	      mem[r+2].int:=xovern(mem[eqtb[2378+n].hh.rh+2].int,curval);
	      mem[r+3].int:=xovern(mem[eqtb[2378+n].hh.rh+3].int,curval);
	      END;
	    END;
	  END;
	END;
      IF aritherror THEN
	BEGIN
	printnl(918);
	BEGIN
	helpptr:=2;
	helpline[1]:=919;
	helpline[0]:=920;
	END;
	error;
	GOTO 10;
	END;
      CASE p OF
	0:IF(a>=4)THEN
	    geqworddefin(3620+n,curval)
	  ELSE
	    eqworddefine(
			 3620+n,curval);
	1:IF(a>=4)THEN
	    geqworddefin(4004+n,curval)
	  ELSE
	    eqworddefine(4004+n,
			 curval);
	2:IF(a>=4)THEN
	    geqdefine(2361+n,98,curval)
	  ELSE
	    eqdefine(2361+n,98,curval
		     );
	END;
      END;
    {1117}88:BEGIN
      scaneightbit;
      IF(a>=4)THEN
	savestack[saveptr+0].int:=1073742080+curval
      ELSE
	savestack[
		  saveptr+0].int:=1073741824+curval;
      scanoptional;
      Scanbox;
      END;
    {1118}89:BEGIN
      scanint;
      n:=curval;
      IF n<=0 THEN
	p:=0
      ELSE
	BEGIN
	p:=getnode(2*n+1);
	mem[p].hh.lh:=n;
	FOR j:=1 TO n DO
	  BEGIN
	  scandimen(false,false,false);
	  mem[p+2*j-1].int:=curval;
	  scandimen(false,false,false);
	  mem[p+2*j].int:=curval;
	  END;
	END;
      IF(a>=4)THEN
	geqdefine(2634,99,p)
      ELSE
	eqdefine(2634,99,p);
      END;
    {1122}90:IF curchr=1 THEN
	       BEGIN
	       newpatterns;
	       GOTO 10;
	       printnl(927);
	       helpptr:=0;
	       error;
	       END
	     ELSE
	       newhyphexcep;
    {1123}74:BEGIN
      scantexinfo(true);
      k:=curval;
      scandimen(false,false,false);
      fontinfo[k].int:=curval;
      END;
    {1124}83:Newfont;
    {1132}91:Newinteracti;
    OTHERS:confusion(874)
    END;
  10:
  END;

  {1134}
PROCEDURE Doassignment;
  BEGIN{362}
  REPEAT
    getnctoken;
  UNTIL curcmd<>10;
  WHILE curcmd>69 DO
    BEGIN
    Prefixedcomm;
    {362}
    REPEAT
      getnctoken;
    UNTIL curcmd<>10;
    END;
  END;
  {1138}
PROCEDURE Issuemessage;
  VAR
    oldsetting:0..21;
    c:0..1;
    s:strnumber;
  BEGIN
  c:=curchr;
  mem[12013].hh.rh:=scantoks(false,true);
  oldsetting:=selector;
  selector:=21;
  tokenshow(curval);
  selector:=oldsetting;
  flushlist(curval);
  BEGIN
  IF poolptr+1>poolsize THEN
    overflow(129,poolsize);
  END;
  s:=makestring;
  IF c=0 THEN
    {1139}
    BEGIN
    IF offset+(strstart[s+1]-strstart[s])>=
    maxprintline THEN
      println
    ELSE
      printchar(32);
    print(s);
    Break(termout);
    END
  ELSE
    {1142}
    BEGIN
    printnl(618);
    print(s);
    IF errhelpseen THEN
      BEGIN
      helpptr:=1;
      helpline[0]:=941;
      END
    ELSE
      BEGIN
      helpptr:=4;
      helpline[3]:=942;
      helpline[2]:=943;
      helpline[1]:=944;
      helpline[0]:=945;
      END;
    error;
    IF interaction<3 THEN
      errhelpseen:=true;
    END;
  ;
  BEGIN
  strptr:=strptr-1;
  poolptr:=strstart[strptr];
  END;
  END;
  {1146}
PROCEDURE Shiftcase;
  VAR
    b:halfword;
    p:halfword;
    t:halfword;
    c:eightbits;
  BEGIN
  p:=scantoks(false,false);
  p:=mem[curval].hh.rh;
  WHILE p<>0 DO
    BEGIN{1147}
    t:=mem[p].hh.lh;
    IF(t<3328)AND(t>=2816)THEN
      BEGIN
      c:=t MOD 256;
      IF c<128 THEN
	IF eqtb[b+c].hh.rh<>0 THEN
	  mem[p].hh.lh:=256*(t DIV 256)+
	  eqtb[b+c].hh.rh;
      END;
    p:=mem[p].hh.rh;
    END;
  begintokenli(mem[curval].hh.rh,3);
  BEGIN
  mem[curval].hh.rh:=avail;
  avail:=curval;
  {DYNUSED:=DYNUSED-1;}
  END;
  END;
  {1151}
PROCEDURE Showwhatever;
  VAR
    p:halfword;
  BEGIN
  CASE curchr OF
    0:{1152}BEGIN
      gettoken;
      IF csptr=0 THEN
	BEGIN
	printnl(956);
	BEGIN
	helpptr:=1;
	helpline[0]:=957;
	END;
	backerror;
	END
      ELSE
	BEGIN
	printnl(958);
	sprintcs(csptr);
	printchar(61);
	printcmdchr(curcmd,curchr);
	IF curcmd>=94 THEN
	  tokenshow(curchr)
	ELSE
	  IF curcmd=93 THEN
	    tokenshow(
		      curmark[curchr]);
	IF interaction<3 THEN
	  BEGIN
	  helpptr:=0;
	  errorcount:=errorcount-1;
	  END
	ELSE
	  BEGIN
	  BEGIN
	  helpptr:=3;
	  helpline[2]:=952;
	  helpline[1]:=953;
	  helpline[0]:=954;
	  END;
	  error;
	  END;
	END;
      END;
    1:{1154}BEGIN
      scaneightbit;
      printnl(964);
      printint(curval);
      printchar(61);
      IF eqtb[2637+curval].hh.rh=0 THEN
	print(965)
      ELSE
	showbox(eqtb[2637+
		     curval].hh.rh);
      IF interaction<3 THEN
	BEGIN
	helpptr:=0;
	errorcount:=errorcount-1;
	END
      ELSE
	BEGIN
	BEGIN
	helpptr:=3;
	helpline[2]:=952;
	helpline[1]:=953;
	helpline[0]:=954;
	END;
	error;
	END;
      END;
    2:{1155}BEGIN
      p:=thetoks(false);
      printnl(958);
      tokenshow(curval);
      flushlist(curval);
      IF interaction<3 THEN
	BEGIN
	helpptr:=0;
	errorcount:=errorcount-1;
	END
      ELSE
	BEGIN
	BEGIN
	helpptr:=3;
	helpline[2]:=952;
	helpline[1]:=953;
	helpline[0]:=954;
	END;
	error;
	END;
      END;
    OTHERS:BEGIN
      showactiviti;
      printnl(955);
      IF interaction<3 THEN
	BEGIN
	helpptr:=0;
	errorcount:=errorcount-1;
	END
      ELSE
	BEGIN
	BEGIN
	helpptr:=3;
	helpline[2]:=952;
	helpline[1]:=953;
	helpline[0]:=954;
	END;
	error;
	END;
      END
    END;
  END;
  {1159}
PROCEDURE Storefmtfile;
  LABEL
    41,42,31,32;
  VAR
    j,k,l:integer;
    p,q:halfword;
    x:integer;
    w:fourquarters;
  BEGIN{1161}
  IF saveptr<>0 THEN
    BEGIN
    printnl(967);
    BEGIN
    helpptr:=1;
    helpline[0]:=968;
    END;
    BEGIN
    IF interaction=3 THEN
      interaction:=2;
    error;
    quit;
    END;
    END;
  {1184}
  IF selector<18 THEN
    openerrfile;
  selector:=21;
  print(978);
  print(jobname);
  printchar(32);
  printint(Abs(eqtb[3606].int)MOD 100);
  printchar(46);
  printint(eqtb[3605].int);
  printchar(46);
  printint(eqtb[3604].int);
  printchar(41);
  BEGIN
  IF poolptr+1>poolsize THEN
    overflow(129,poolsize);
  END;
  IF interaction=0 THEN
    selector:=18
  ELSE
    selector:=19;
  formatident:=makestring;
  packjobname(979);
  WHILE NOT wopenout(fmtfile)DO promptfilena(980,979);
  printnl(981);
  print(wmakenamestr(fmtfile));
  BEGIN
  strptr:=strptr-1;
  poolptr:=strstart[strptr];
  END;
  print(formatident);
  {1164}fmtfile↑.int:=157476531;
  Put(fmtfile);
  fmtfile↑.int:=12000;
  Put(fmtfile);
  fmtfile↑.int:=4277;
  Put(fmtfile);
  fmtfile↑.int:=1777;
  Put(fmtfile);
  fmtfile↑.int:=307;
  Put(fmtfile);;
  {1166}fmtfile↑.int:=poolptr;
  Put(fmtfile);
  fmtfile↑.int:=strptr;
  Put(fmtfile);
  FOR k:=0 TO strptr DO fmtfile↑.int:=strstart[k];
  Put(fmtfile);
  k:=0;
  WHILE k+4<poolptr DO
    BEGIN
    w.b0:=strpool[k];
    w.b1:=strpool[k+1];
    w.b2:=strpool[k+2];
    w.b3:=strpool[k+3];
    fmtfile↑.qqqq:=w;
    Put(fmtfile);
    k:=k+4;
    END;
  k:=poolptr-4;
  w.b0:=strpool[k];
  w.b1:=strpool[k+1];
  w.b2:=strpool[k+2];
  w.b3:=strpool[k+3];
  fmtfile↑.qqqq:=w;
  Put(fmtfile);
  println;
  printint(strptr);
  print(969);
  printint(poolptr);
  {1168}sortavail;
  varused:=0;
  fmtfile↑.int:=rover;
  Put(fmtfile);
  p:=0;
  q:=rover;
  x:=0;
  REPEAT
    FOR k:=p TO q+1 DO
      BEGIN
      fmtfile↑:=mem[k];
      Put(fmtfile);
      x:=x+q+2-p;
      varused:=varused+q-p;
      END;
    p:=q+mem[q].hh.lh;
    q:=mem[q+1].hh.rh;
  UNTIL q=rover;
  varused:=varused+12000-p;
  dynused:=memend-12000;
  fmtfile↑.int:=memend;
  Put(fmtfile);
  fmtfile↑.int:=avail;
  Put(fmtfile);
  FOR k:=p TO memend DO fmtfile↑:=mem[k];
  Put(fmtfile);
  p:=avail;
  WHILE p<>0 DO
    BEGIN
    dynused:=dynused-1;
    p:=mem[p].hh.rh;
    END;
  fmtfile↑.int:=varused;
  Put(fmtfile);
  fmtfile↑.int:=dynused;
  Put(fmtfile);
  println;
  printint(x+memend+1-p);
  print(970);
  printint(varused);
  printchar(44);
  printint(dynused);
  {1170}{1171}k:=1;
  REPEAT
    j:=k;
    WHILE j<3582 DO
      BEGIN
      IF(eqtb[j].hh.rh=eqtb[j+1].hh.rh)AND(eqtb[j].hh.b0
					   =eqtb[j+1].hh.b0)AND(eqtb[j].hh.b1=eqtb[j+1].hh.b1)THEN
	GOTO 41;
      j:=j+1;
      END;
    l:=3583;
    GOTO 31;
  41:
    j:=j+1;
    l:=j;
    WHILE j<3582 DO
      BEGIN
      IF(eqtb[j].hh.rh=eqtb[j+1].hh.rh)AND(eqtb[j].hh.b0
					   =eqtb[j+1].hh.b0)AND(eqtb[j].hh.b1=eqtb[j+1].hh.b1)THEN
	GOTO 31;
      j:=j+1;
      END;
  31:
    fmtfile↑.int:=l-k;
    Put(fmtfile);
    WHILE k<l DO
      BEGIN
      fmtfile↑:=eqtb[k];
      Put(fmtfile);
      k:=k+1;
      END;
    k:=j+1;
    fmtfile↑.int:=k-l;
    Put(fmtfile);
  UNTIL k=3583;
  {1172}
  REPEAT
    j:=k;
    WHILE j<4277 DO
      BEGIN
      IF eqtb[j].int=eqtb[j+1].int THEN
	GOTO 42;
      j:=j+1;
      END;
    l:=4278;
    GOTO 32;
  42:
    j:=j+1;
    l:=j;
    WHILE j<4277 DO
      BEGIN
      IF eqtb[j].int=eqtb[j+1].int THEN
	GOTO 32;
      j:=j+1;
      END;
  32:
    fmtfile↑.int:=l-k;
    Put(fmtfile);
    WHILE k<l DO
      BEGIN
      fmtfile↑:=eqtb[k];
      Put(fmtfile);
      k:=k+1;
      END;
    k:=j+1;
    fmtfile↑.int:=k-l;
    Put(fmtfile);
  UNTIL k>4277;
  {1174}fmtfile↑.int:=hashused;
  Put(fmtfile);
  cscount:=2356-hashused;
  FOR p:=257 TO hashused DO
    IF hash[p].rh<>0 THEN
      BEGIN
      fmtfile↑.int:=p;
      Put(fmtfile);
      fmtfile↑.hh:=hash[p];
      Put(fmtfile);
      cscount:=cscount+1;
      END;
  FOR p:=hashused+1 TO 2359 DO fmtfile↑.hh:=hash[p];
  Put(fmtfile);
  fmtfile↑.int:=cscount;
  Put(fmtfile);
  println;
  printint(cscount);
  print(971);
  {1176}fmtfile↑.int:=fmemptr;
  Put(fmtfile);
  FOR k:=7 TO fmemptr-1 DO fmtfile↑:=fontinfo[k];
  Put(fmtfile);
  fmtfile↑.int:=fontptr;
  Put(fmtfile);
  FOR k:=1 TO fontptr DO{1178}
    BEGIN
    fmtfile↑.int:=fontcode[k];
    Put(fmtfile);
    fmtfile↑.qqqq:=fontcheck[k];
    Put(fmtfile);
    fmtfile↑.int:=fontsize[k];
    Put(fmtfile);
    IF fontscaled[k]THEN
      BEGIN
      fmtfile↑.int:=1;
      Put(fmtfile);
      END
    ELSE
      BEGIN
      fmtfile↑.int:=0;
      Put(fmtfile);
      END;
    fmtfile↑.int:=fontparams[k];
    Put(fmtfile);
    fmtfile↑.int:=fontname[k];
    Put(fmtfile);
    fmtfile↑.int:=fontarea[k];
    Put(fmtfile);
    fmtfile↑.int:=fontbc[k];
    Put(fmtfile);
    fmtfile↑.int:=fontec[k];
    Put(fmtfile);
    fmtfile↑.int:=charbase[k];
    Put(fmtfile);
    fmtfile↑.int:=widthbase[k];
    Put(fmtfile);
    fmtfile↑.int:=heightbase[k];
    Put(fmtfile);
    fmtfile↑.int:=depthbase[k];
    Put(fmtfile);
    fmtfile↑.int:=italicbase[k];
    Put(fmtfile);
    fmtfile↑.int:=ligkernbase[k];
    Put(fmtfile);
    fmtfile↑.int:=kernbase[k];
    Put(fmtfile);
    fmtfile↑.int:=extenbase[k];
    Put(fmtfile);
    fmtfile↑.int:=parambase[k];
    Put(fmtfile);
    fmtfile↑.int:=fontglue[k];
    Put(fmtfile);
    printnl(974);
    printint(fontcode[k]);
    printchar(61);
    printfilenam(fontname[k],fontarea[k],529);
    IF fontscaled[k]THEN
      BEGIN
      print(544);
      printscaled(fontsize[k]);
      print(482);
      END;
    END;
  FOR k:=0 TO badfontcode-1 DO
    IF(fontnumber[k]<>0)AND(fontcode[fontnumber
				     [k]]<>k)THEN
      BEGIN
      fmtfile↑.int:=fontnumber[k];
      Put(fmtfile);
      fmtfile↑.int:=k;
      Put(fmtfile);
      END;
  fmtfile↑.int:=0;
  Put(fmtfile);
  println;
  printint(fmemptr-7);
  print(972);
  printint(fontptr-0);
  print(973);
  {1180}fmtfile↑.int:=hyphcount;
  Put(fmtfile);
  FOR k:=0 TO 307 DO
    IF hyphword[k]<>0 THEN
      BEGIN
      fmtfile↑.int:=k;
      Put(fmtfile);
      fmtfile↑.int:=hyphword[k];
      Put(fmtfile);
      fmtfile↑.int:=hyphlist[k];
      Put(fmtfile);
      END;
  fmtfile↑.int:=triemax;
  Put(fmtfile);
  FOR k:=0 TO triemax DO fmtfile↑.hh:=trie[k];
  Put(fmtfile);
  fmtfile↑.int:=trieopptr;
  Put(fmtfile);
  FOR k:=1 TO trieopptr DO
    BEGIN
    fmtfile↑.int:=hyfdistance[k];
    Put(fmtfile);
    fmtfile↑.int:=hyfnum[k];
    Put(fmtfile);
    fmtfile↑.int:=hyfnext[k];
    Put(fmtfile);
    END;
  println;
  printint(hyphcount);
  print(975);
  printnl(976);
  printint(triemax);
  print(564);
  printint((trieopptr-0));
  print(977);
  {1182}fmtfile↑.int:=interaction;
  Put(fmtfile);
  fmtfile↑.int:=formatident;
  Put(fmtfile);
  fmtfile↑.int:=69069;
  Put(fmtfile);
  wclose(fmtfile);
  END;

  {1205}{1206}
PROCEDURE Newwhatsit(s:smallnumber;
		     w:smallnumber);
  VAR
    p:halfword;
  BEGIN
  p:=getnode(w);
  mem[p].hh.b0:=8;
  mem[p].hh.b1:=s;
  mem[curlist.tailfield].hh.rh:=p;
  curlist.tailfield:=p;
  END;
  {1207}
PROCEDURE Newsendwhats(w:smallnumber);
  VAR
    p:halfword;
  BEGIN
  Newwhatsit(curchr,w);
  scanfourbiti;
  mem[curlist.tailfield+1].hh.lh:=curval;
  END;
PROCEDURE Doextension;
  VAR
    i,j,k:integer;
    p,q,r:halfword;
  BEGIN
  CASE curchr OF
    0:{1208}BEGIN
      Newsendwhats(3);
      scanoptional;
      scanfilename;
      mem[curlist.tailfield+1].hh.rh:=curname;
      mem[curlist.tailfield+2].hh.lh:=curarea;
      mem[curlist.tailfield+2].hh.rh:=curext;
      END;
    1:{1209}BEGIN
      k:=csptr;
      Newsendwhats(2);
      csptr:=k;
      p:=scantoks(false,false);
      mem[curlist.tailfield+1].hh.rh:=curval;
      END;
    2:{1210}BEGIN
      Newsendwhats(2);
      mem[curlist.tailfield+1].hh.rh:=0;
      END;
    3:{1212}BEGIN
      Newwhatsit(3,2);
      mem[curlist.tailfield+1].hh.lh:=0;
      p:=scantoks(false,true);
      mem[curlist.tailfield+1].hh.rh:=curval;
      END;
    OTHERS:confusion(994)
    END;
  END;
  {938}
PROCEDURE Handlerightb;
  LABEL
    30,10;
  VAR
    p:halfword;
  BEGIN
  CASE curgroup OF
    1:unsave;
    0:BEGIN
      printnl(728);
      BEGIN
      helpptr:=2;
      helpline[1]:=729;
      helpline[0]:=730;
      END;
      error;
      END;
    15,16,17:Extrarightbr;
    {955}2:Package(0);
    3:BEGIN
      Endgraf;
      Package(0);
      END;
    4:BEGIN
      Endgraf;
      Package(4);
      END;
    {970}13:BEGIN
      Endgraf;
      unsave;
      saveptr:=saveptr-1;
      IF curlist.headfield<>curlist.tailfield THEN
	BEGIN
	p:=vpackage(mem[
			curlist.headfield].hh.rh,0,1,134217727);
	popnest;
	IF savestack[saveptr+0].int<255 THEN
	  BEGIN
	  BEGIN
	  mem[curlist.tailfield].
	  hh.rh:=getnode(3);
	  curlist.tailfield:=mem[curlist.tailfield].hh.rh;
	  END;
	  mem[curlist.tailfield].hh.b0:=3;
	  mem[curlist.tailfield].hh.b1:=(savestack[saveptr+0].int+0);
	  mem[curlist.tailfield+1].int:=mem[p+3].int+mem[p+2].int;
	  mem[curlist.tailfield+2].int:=mem[p+5].hh.rh;
	  END
	ELSE
	  BEGIN
	  BEGIN
	  mem[curlist.tailfield].hh.rh:=getnode(2);
	  curlist.tailfield:=mem[curlist.tailfield].hh.rh;
	  END;
	  mem[curlist.tailfield].hh.b0:=5;
	  mem[curlist.tailfield].hh.b1:=0;
	  mem[curlist.tailfield+1].int:=mem[p+5].hh.rh;
	  END;
	freenode(p,7);
	END;
      {365}
      BEGIN
      getnctoken;
      IF curcmd<>10 THEN
	backinput;
      END;
      END;
    10:{896}BEGIN
      unsave;
      outputactive:=false;
      {897}
      IF eqtb[2892].hh.rh<>0 THEN
	BEGIN
	BEGIN
	helpptr:=3;
	helpline[2]:=688;
	helpline[1]:=689;
	helpline[0]:=690;
	END;
	printnl(691);
	error;
	flushnodelis(eqtb[2892].hh.rh);
	eqtb[2892].hh.rh:=0;
	END;
      IF curlist.tailfield<>curlist.headfield THEN
	BEGIN
	mem[curlist.tailfield
	    ].hh.rh:=mem[12001].hh.rh;
	mem[12001].hh.rh:=mem[curlist.headfield].hh.rh;
	END;
      popnest;
      buildpage;
      END;
    {988}12:Builddiscret;
    {1006}9:BEGIN
      Endgraf;
      unsave;
      alignpeek;
      END;
    {1037}14:BEGIN
      Endgraf;
      unsave;
      saveptr:=saveptr-2;
      p:=vpackage(mem[curlist.headfield].hh.rh,savestack[saveptr+1].int,
		  savestack[saveptr+0].int,134217727);
      popnest;
      BEGIN
      mem[curlist.tailfield].hh.rh:=newnoad;
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
      mem[curlist.tailfield].hh.b0:=28;
      mem[curlist.tailfield+1].hh.rh:=2;
      mem[curlist.tailfield+1].hh.lh:=p;
      END;
    {1053}11:BEGIN
      unsave;
      saveptr:=saveptr-1;
      mem[savestack[saveptr+0].int].hh.rh:=3;
      mem[savestack[saveptr+0].int].hh.lh:=Finmlist(0);
      END;
    {1084}5:BEGIN
      leavetranspa;
      {362}
      REPEAT
	getnctoken;
      UNTIL curcmd<>10;
      IF curcmd=57 THEN
	passblock(0)
      ELSE
	BEGIN
	printnl(856);
	BEGIN
	helpptr:=3;
	helpline[2]:=860;
	helpline[1]:=858;
	helpline[0]:=859;
	END;
	backerror;
	END;
      END;
    6:BEGIN
      leavetranspa;
      {365}
      BEGIN
      getnctoken;
      IF curcmd<>10 THEN
	backinput;
      END;
      END;
    {1088}7:BEGIN
      leavetranspa;
      WHILE true DO
	BEGIN{362}
	REPEAT
	  getnctoken;
	UNTIL curcmd<>10;
	IF curcmd=1 THEN
	  passblock(1)
	ELSE
	  IF curcmd=57 THEN
	    GOTO 30
	  ELSE
	    {1089}
	    BEGIN
	    printnl(864);
	    BEGIN
	    helpptr:=3;
	    helpline[2]:=865;
	    helpline[1]:=866;
	    helpline[0]:=859;
	    END;
	    backerror;
	    GOTO 10;
	    END;
	END;
  30:
      passblock(0);
      END;
    OTHERS:confusion(731)
    END;
  10:
  END;
PROCEDURE Maincontrol;
  LABEL
    60,21,70,71,72,73,74,10;
  VAR
    t:integer;
    {900}l:quarterword;
    c:eightbits;
    f:internalfont;
    r:halfword;
    p:halfword;
    k:0..fontmemsize;
    q:halfword;
    i:fourquarters;
    j:fourquarters;
    s:integer;
    ligaturepres:boolean;
  BEGIN
  60:
  getnctoken;
  BEGIN
  IF interrupt<>0 THEN
    pauseforinst;
  END;
  {IF PANICKING THEN CHECKMEM(FALSE);
  }21:
  CASE Abs(curlist.modefield)+curcmd OF
    104,105:GOTO 70;
    109:BEGIN
      scancharnum;
      curchr:=curval;
      GOTO 70;
      END;
    103:IF curlist.auxfield=1000 THEN
	  GOTO 74
	ELSE
	  Appspace;
    156,248:GOTO 74;
    {914}1,93,185,11,14,195:;
    40,132,224:BEGIN{362}
      REPEAT
	getnctoken;
      UNTIL curcmd<>10;
      GOTO 21;
      END;
    20:startinput;
    15:GOTO 10;
      {919}112,204,{925}36,129,221,{943}24,115,207,{961}226,{968}39,223,{981}
    209,43,{995}228,{1003}34,125,218,{1015}47,139,7,99,191:Reportillega;
      {917}8,100,9,101,18,110,49,141,16,108,48,140,51,143,65,157,52,144,54,146
    ,53,145,31,123,50,142,29,121,45,137,194,198,199,212:BEGIN
      Insertdollar;
      GOTO 21;
      END;
    {924}37,128,220:BEGIN
      BEGIN
      mem[curlist.tailfield].hh.rh:=scanrulespec;
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
      IF Abs(curlist.modefield)=1 THEN
	curlist.auxfield:=-65536000;
      END;
    {926}28,119,211,213:Appendglue;
    30,122,214,215:Appendkern;
    {932}2,94:newsavelevel(1);
    61,153,245:newsavelevel(15);
    62,154,246:IF curgroup=15 THEN
		 unsave
	       ELSE
		 Offsave;
    {937}3,95,187:Handlerightb;
    {942}23,116,208:BEGIN
      t:=curchr;
      scandimen(false,false,false);
      IF t=0 THEN
	savestack[saveptr+0].int:=curval
      ELSE
	savestack[saveptr+0].
	int:=-curval;
      Scanbox;
      END;
    32,124,216:BEGIN
      savestack[saveptr+0].int:=1073742237+curchr;
      Scanbox;
      END;
    22,114,206:BEGIN
      savestack[saveptr+0].int:=0;
      Beginbox;
      END;
    {960}42:Newgraf(curchr>0);
    12,13,17,4,66,67,44,46,27,64,68:BEGIN
      Newgraf(true);
      GOTO 21;
      END;
    {963}134:Indentinhmod;
    {965}106:BEGIN
      Endgraf;
      IF curlist.modefield=1 THEN
	buildpage;
      END;
    107,120:BEGIN
      backinput;
      curtok:=partoken;
      csptr:=parloc;
      curcmd:=eqtb[csptr].hh.b0;
      curchr:=eqtb[csptr].hh.rh;
      GOTO 21;
      END;
    {967}38,130,222,131:Begininserto;
    19,111,203:Makemark;
    {972}70,162,254:Changeaux;
    {974}41,133,225:Appendpenalt;
    {976}26,118,210:Deleteskip;
    {979}25,117:Unpackage;
    {982}135:Appenditalic;
    227:BEGIN
      mem[curlist.tailfield].hh.rh:=newkern(0);
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
    {986}138,230:Appenddiscre;
    {992}158,250:BEGIN
      mem[12013].hh.rh:=thetoks(curchr>0);
      begintokenli(curval,3);
      END;
    159,251:BEGIN
      mem[12013].hh.rh:=numtoks;
      begintokenli(curval,3);
      END;
    160,252,161,253:Insthe;
    {994}136:Makeaccent;
    {999}6,98,190,5,97,189:BEGIN
      Alignerror;
      GOTO 21;
      END;
    35,127,219:Noalignerror;
    63,155,247:Omiterror;
    {1004}33,126:initalign;
    217:IF Privileged THEN
	  IF curgroup=16 THEN
	    initalign
	  ELSE
	    Offsave;
    10,102:Doendv;
    {1007}96:Initmath;
    {1011}231:IF Privileged THEN
		Starteqno;
    {1021}186:BEGIN
      BEGIN
      mem[curlist.tailfield].hh.rh:=newnoad;
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
      backinput;
      Scanmath(curlist.tailfield+1);
      END;
    {1024}196,197:Setmathchar(eqtb[3071+curchr].hh.rh);
    201:BEGIN
      scancharnum;
      Setmathchar(curval+28672);
      END;
    202:BEGIN
      scanfifteenb;
      Setmathchar(curval);
      END;
    200:BEGIN
      scantwentyse;
      Setmathchar(curval DIV 4096);
      END;
    {1028}233:BEGIN
      BEGIN
      mem[curlist.tailfield].hh.rh:=newnoad;
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
      mem[curlist.tailfield].hh.b0:=curchr;
      Scanmath(curlist.tailfield+1);
      END;
    234:Mathlimitswi;
    {1032}249:Mathradical;
    {1034}229:Mathac;
    {1036}238:BEGIN
      scanspec;
      newsavelevel(14);
      pushnest;
      curlist.modefield:=-1;
      curlist.auxfield:=-65536000;
      END;
    {1040}236:BEGIN
      mem[curlist.tailfield].hh.rh:=newstyle(curchr);
      curlist.tailfield:=mem[curlist.tailfield].hh.rh;
      END;
    237:Mathnonscrip;
    {1042}193,192:Subsup;
    {1047}235:Mathfraction;
    {1056}232:Mathleftrigh;
    {1059}188:IF curgroup=16 THEN
		Finmath
	      ELSE
		Offsave;
    {1075}56,148,240:Conditional;
    {1085}57,149,241:Caseconditio;
    58,150,242:Spuriouselse;
      {1092}71,163,255,72,164,256,73,165,257,74,166,258,75,167,259,76,168,260,
    77,169,261,78,170,262,79,171,263,80,172,264,81,173,265,82,174,266,83,175
    ,267,84,176,268,85,177,269,86,178,270,87,179,271,88,180,272,89,181,273,
    90,182,274,91,183,275,92,184,276:Prefixedcomm;
    {1135}59,151,243:Issuemessage;
    {1143}55,147,239:Shiftcase;
    {1148}21,113,205:Showwhatever;
    {1204}60,152,244:Doextension;
    END;
  GOTO 60;
  70:{901}
  f:=eqtb[2893].hh.rh;
  IF f=0 THEN
    BEGIN
    Missingfont;
    GOTO 60;
    END;
  c:=curchr;
  71:
  IF(c<fontbc[f])OR(c>fontec[f])THEN
    BEGIN
    charwarning(f,c);
    GOTO 60;
    END;
  72:
  q:=curlist.tailfield;
  ligaturepres:=false;
  l:=(c+0);
  73:{903}
  IF c<128 THEN
    BEGIN
    s:=eqtb[3455+c].hh.rh;
    IF s=1000 THEN
      curlist.auxfield:=1000
    ELSE
      IF s<1000 THEN
	BEGIN
	IF s>0
	THEN
	  curlist.auxfield:=s;
	END
      ELSE
	IF curlist.auxfield<1000 THEN
	  curlist.auxfield:=1000
	ELSE
	  curlist.auxfield:=s;
    END
  ELSE
    curlist.auxfield:=1000;
  {904}i:=fontinfo[charbase[f]+l].qqqq;
  IF(i.b0>0)THEN
    BEGIN
    p:=avail;
    IF p=0 THEN
      p:=getavail
    ELSE
      BEGIN
      avail:=mem[p].hh.rh;
      mem[p].hh.rh:=0;
      {DYNUSED:=DYNUSED+1;}
      END;
    mem[p].hh.b0:=f;
    mem[p].hh.b1:=(c+0);
    mem[curlist.tailfield].hh.rh:=p;
    curlist.tailfield:=p;
    END
  ELSE
    charwarning(f,(l-0));
  {905}getnext;
  IF(curcmd=11)OR(curcmd=12)THEN
    r:=(curchr+0)
  ELSE
    BEGIN
    nctoken;
    IF curcmd=16 THEN
      BEGIN
      scancharnum;
      r:=(curval+0);
      END
    ELSE
      r:=(256);
    END;
  IF(((i.b2-0)MOD 4)=1)AND(r<>(256))THEN
    {906}
    BEGIN
    k:=ligkernbase[f]+i.b3;
    REPEAT
      j:=fontinfo[k].qqqq;
      IF j.b1=r THEN
	IF j.b2<128 THEN
	  {909}
	  BEGIN
	  ligaturepres:=true;
	  l:=j.b3;
	  c:=(r-0);
	  GOTO 73;
	  END
	ELSE
	  {907}
	  BEGIN{908}
	  IF ligaturepres THEN
	    BEGIN
	    p:=newligature(f,c,mem
			   [q].hh.rh);
	    mem[q].hh.rh:=p;
	    curlist.tailfield:=p;
	    END;
	  IF c=45 THEN
	    BEGIN
	    mem[curlist.tailfield].hh.rh:=newdisc;
	    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
	    END;
	  BEGIN
	  mem[curlist.tailfield].hh.rh:=newkern(fontinfo[kernbase[f]+j.b3].
						int);
	  curlist.tailfield:=mem[curlist.tailfield].hh.rh;
	  END;
	  c:=(r-0);
	  GOTO 72;
	  END;
      k:=k+1;
    UNTIL j.b0>=128;
    END;
  {908}
  IF ligaturepres THEN
    BEGIN
    p:=newligature(f,c,mem[q].hh.rh);
    mem[q].hh.rh:=p;
    curlist.tailfield:=p;
    END;
  IF c=45 THEN
    BEGIN
    mem[curlist.tailfield].hh.rh:=newdisc;
    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    END;
  IF r=(256)THEN
    GOTO 21;
  c:=(r-0);
  GOTO 71;;
  74:{910}
  IF eqtb[2372].hh.rh=0 THEN
    BEGIN{911}
    BEGIN
    p:=fontglue[eqtb[2893
		     ].hh.rh];
    IF p=0 THEN
      BEGIN
      f:=eqtb[2893].hh.rh;
      p:=newspec(0);
      k:=parambase[f]+2;
      mem[p+1].int:=fontinfo[k].int;
      mem[p+2].int:=fontinfo[k+1].int;
      mem[p+3].int:=fontinfo[k+2].int;
      fontglue[f]:=p;
      END;
    END;
    q:=newglue(p);
    END
  ELSE
    q:=newparamglue(11);
  mem[curlist.tailfield].hh.rh:=q;
  curlist.tailfield:=q;
  GOTO 60;
  10:
  END;
  {1160}{439}
FUNCTION Openfmtfile:boolean;
  LABEL
    40,10;
  VAR
    j:0..bufsize;
  BEGIN
  IF buffer[curinput.locfield]<>92 THEN
    BEGIN
    j:=curinput.locfield+1
    ;
    buffer[curinput.limitfield]:=32;
    WHILE buffer[j]<>32 DO j:=j+1;
    packbuffered(0,curinput.locfield,j-1);
    IF wopenin(fmtfile)THEN
      BEGIN
      curinput.locfield:=j;
      GOTO 40;
      END;
    packbuffered(13,curinput.locfield,j-1);
    IF wopenin(fmtfile)THEN
      BEGIN
      curinput.locfield:=j;
      GOTO 40;
      END;
    END;
  packbuffered(18,1,0);
  IF NOT wopenin(fmtfile)THEN
    BEGIN
    Writeln(termout,
	    'I can''t find the BASIC format file!');
    Openfmtfile:=false;
    GOTO 10;
    END;
  40:
  Openfmtfile:=true;
  10:
  END;
FUNCTION Loadfmtfile:boolean;
  LABEL
    6666,10;
  VAR
    j,k:integer;
    p,q:halfword;
    x,y:integer;
    w:fourquarters;
  BEGIN{1165}
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF x<>157476531 THEN
    GOTO 6666;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF x<>12000 THEN
    GOTO 6666;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF x<>4277 THEN
    GOTO 6666;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF x<>1777 THEN
    GOTO 6666;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF x<>307 THEN
    GOTO 6666;
  ;
  {1167}Get(fmtfile);
  x:=fmtfile↑.int;
  IF x<0 THEN
    GOTO 6666;
  IF x>poolsize THEN
    BEGIN
    Write(termout,'---! Must increase the ',
	  'string pool size');
    GOTO 6666;
    END
  ELSE
    poolptr:=x;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF x<0 THEN
    GOTO 6666;
  IF x>maxstrings THEN
    BEGIN
    Write(termout,'---! Must increase the ',
	  'max strings');
    GOTO 6666;
    END
  ELSE
    strptr:=x;
  FOR k:=0 TO strptr DO Get(fmtfile);
  x:=fmtfile↑.int;
  IF(x<0)OR(x>poolptr)THEN
    GOTO 6666
  ELSE
    strstart[k]:=x;
  k:=0;
  WHILE k+4<poolptr DO
    BEGIN
    Get(fmtfile);
    w:=fmtfile↑.qqqq;
    strpool[k]:=w.b0;
    strpool[k+1]:=w.b1;
    strpool[k+2]:=w.b2;
    strpool[k+3]:=w.b3;
    k:=k+4;
    END;
  k:=poolptr-4;
  Get(fmtfile);
  w:=fmtfile↑.qqqq;
  strpool[k]:=w.b0;
  strpool[k+1]:=w.b1;
  strpool[k+2]:=w.b2;
  strpool[k+3]:=w.b3;
  {1169}Get(fmtfile);
  x:=fmtfile↑.int;
  IF(x<0)OR(x>12000)THEN
    GOTO 6666
  ELSE
    rover:=x;
  p:=0;
  q:=rover;
  x:=0;
  REPEAT
    FOR k:=p TO q+1 DO Get(fmtfile);
    mem[k]:=fmtfile↑;
    p:=q+mem[q].hh.lh;
    IF(p>12000)OR((q<=mem[q+1].hh.rh)AND(q<>rover))THEN
      GOTO 6666;
    q:=mem[q+1].hh.rh;
  UNTIL q=rover;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF x<12000 THEN
    GOTO 6666;
  IF x>memmax THEN
    BEGIN
    Write(termout,'---! Must increase the ','mem max'
	  );
    GOTO 6666;
    END
  ELSE
    memend:=x;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF(x<12000)OR(x>memend)THEN
    GOTO 6666
  ELSE
    avail:=x;
  FOR k:=p TO memend DO Get(fmtfile);
  mem[k]:=fmtfile↑;
  Get(fmtfile);
  varused:=fmtfile↑.int;
  Get(fmtfile);
  dynused:=fmtfile↑.int;
  maxvarused:=varused;
  {1175}{1173}k:=1;
  REPEAT
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<1)OR(k+x>4277)THEN
      GOTO 6666;
    FOR j:=k TO k+x-1 DO Get(fmtfile);
    eqtb[j]:=fmtfile↑;
    k:=k+x;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(k+x>4278)THEN
      GOTO 6666;
    FOR j:=k TO k+x-1 DO eqtb[j]:=eqtb[k-1];
    k:=k+x;
  UNTIL k>4277;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF(x<257)OR(x>2357)THEN
    GOTO 6666
  ELSE
    hashused:=x;
  p:=256;
  REPEAT
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<p+1)OR(x>hashused)THEN
      GOTO 6666
    ELSE
      p:=x;
    Get(fmtfile);
    hash[p]:=fmtfile↑.hh;
  UNTIL p=hashused;
  FOR p:=hashused+1 TO 2359 DO Get(fmtfile);
  hash[p]:=fmtfile↑.hh;
  Get(fmtfile);
  cscount:=fmtfile↑.int;
  {1177}Get(fmtfile);
  x:=fmtfile↑.int;
  IF x<7 THEN
    GOTO 6666;
  IF x>fontmemsize THEN
    BEGIN
    Write(termout,'---! Must increase the ',
	  'font mem size');
    GOTO 6666;
    END
  ELSE
    fmemptr:=x;
  FOR k:=7 TO fmemptr-1 DO Get(fmtfile);
  fontinfo[k]:=fmtfile↑;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF x<0 THEN
    GOTO 6666;
  IF x>fontmax THEN
    BEGIN
    Write(termout,'---! Must increase the ',
	  'font max');
    GOTO 6666;
    END
  ELSE
    fontptr:=x;
  FOR k:=1 TO fontptr DO{1179}
    BEGIN
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>badfontcode)THEN
      GOTO 6666
    ELSE
      fontcode[k]:=x;
    fontnumber[fontcode[k]]:=k;
    Get(fmtfile);
    fontcheck[k]:=fmtfile↑.qqqq;
    Get(fmtfile);
    fontsize[k]:=fmtfile↑.int;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF x=0 THEN
      fontscaled[k]:=false
    ELSE
      IF x=1 THEN
	fontscaled[k]:=true
      ELSE
	GOTO 6666;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>65535)THEN
      GOTO 6666
    ELSE
      fontparams[k]:=x;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>strptr)THEN
      GOTO 6666
    ELSE
      fontname[k]:=x;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>strptr)THEN
      GOTO 6666
    ELSE
      fontarea[k]:=x;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>255)THEN
      GOTO 6666
    ELSE
      fontbc[k]:=x;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>255)THEN
      GOTO 6666
    ELSE
      fontec[k]:=x;
    Get(fmtfile);
    charbase[k]:=fmtfile↑.int;
    Get(fmtfile);
    widthbase[k]:=fmtfile↑.int;
    Get(fmtfile);
    heightbase[k]:=fmtfile↑.int;
    Get(fmtfile);
    depthbase[k]:=fmtfile↑.int;
    Get(fmtfile);
    italicbase[k]:=fmtfile↑.int;
    Get(fmtfile);
    ligkernbase[k]:=fmtfile↑.int;
    Get(fmtfile);
    kernbase[k]:=fmtfile↑.int;
    Get(fmtfile);
    extenbase[k]:=fmtfile↑.int;
    Get(fmtfile);
    parambase[k]:=fmtfile↑.int;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>12000)THEN
      GOTO 6666
    ELSE
      fontglue[k]:=x;
    END;
  REPEAT
    Get(fmtfile);
    y:=fmtfile↑.int;
    IF Eof(fmtfile)THEN
      GOTO 6666;
    IF y<>0 THEN
      BEGIN
      IF(y<0)OR(y>=fontptr)THEN
	GOTO 6666;
      Get(fmtfile);
      x:=fmtfile↑.int;
      IF(x<0)OR(x>badfontcode)THEN
	GOTO 6666
      ELSE
	k:=x;
      fontnumber[k]:=y;
      END;
  UNTIL y=0;
  {1181}Get(fmtfile);
  x:=fmtfile↑.int;
  IF(x<0)OR(x>307)THEN
    GOTO 6666
  ELSE
    hyphcount:=x;
  FOR k:=1 TO hyphcount DO
    BEGIN
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>307)THEN
      GOTO 6666
    ELSE
      j:=x;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>strptr)THEN
      GOTO 6666
    ELSE
      hyphword[k]:=x;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>65535)THEN
      GOTO 6666
    ELSE
      hyphlist[k]:=x;
    END;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF x<0 THEN
    GOTO 6666;
  IF x>triesize THEN
    BEGIN
    Write(termout,'---! Must increase the ',
	  'trie size');
    GOTO 6666;
    END
  ELSE
    triemax:=x;
  FOR k:=0 TO triemax DO Get(fmtfile);
  trie[k]:=fmtfile↑.hh;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF(x<0)OR(x>255)THEN
    GOTO 6666
  ELSE
    trieopptr:=x;
  FOR k:=1 TO trieopptr DO
    BEGIN
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>63)THEN
      GOTO 6666
    ELSE
      hyfdistance[k]:=x;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>63)THEN
      GOTO 6666
    ELSE
      hyfnum[k]:=x;
    Get(fmtfile);
    x:=fmtfile↑.int;
    IF(x<0)OR(x>255)THEN
      GOTO 6666
    ELSE
      hyfnext[k]:=x;
    END;
  {1183}Get(fmtfile);
  x:=fmtfile↑.int;
  IF(x<0)OR(x>3)THEN
    GOTO 6666
  ELSE
    interaction:=x;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF(x<0)OR(x>strptr)THEN
    GOTO 6666
  ELSE
    formatident:=x;
  Get(fmtfile);
  x:=fmtfile↑.int;
  IF(x<>69069)OR Eof(fmtfile)THEN
    GOTO 6666;
  Loadfmtfile:=true;
  GOTO 10;
  6666:
  Loadfmtfile:=false;
  10:
  END;

  {1185}{1189}
PROCEDURE Closefilesan;
  VAR
    k:integer;
  BEGIN{DEBUGHELP;
  }{549}
  IF totalpages=0 THEN
    printnl(574)
  ELSE
    BEGIN
    BEGIN
    dvibuf[dviptr]:=
    240;
    dviptr:=dviptr+1;
    IF dviptr=dvilimit THEN
      dviswap;
    END;
    dvifour(lastbop);
    lastbop:=dvioffset+dviptr-5;
    dvifour(25400000);
    dvifour(473628672);
    preparemag;
    dvifour(eqtb[3600].int);
    dvifour(maxv);
    dvifour(maxh);
    BEGIN
    dvibuf[dviptr]:=maxpush DIV 256;
    dviptr:=dviptr+1;
    IF dviptr=dvilimit THEN
      dviswap;
    END;
    BEGIN
    dvibuf[dviptr]:=maxpush MOD 256;
    dviptr:=dviptr+1;
    IF dviptr=dvilimit THEN
      dviswap;
    END;
    BEGIN
    dvibuf[dviptr]:=totalpages DIV 256;
    dviptr:=dviptr+1;
    IF dviptr=dvilimit THEN
      dviswap;
    END;
    BEGIN
    dvibuf[dviptr]:=totalpages MOD 256;
    dviptr:=dviptr+1;
    IF dviptr=dvilimit THEN
      dviswap;
    END;
    {550}
    WHILE fontptr>0 DO
      BEGIN
      IF fontused[fontptr]THEN
	BEGIN
	dvifour(
		fontptr-1);
	BEGIN
	dvibuf[dviptr]:=(fontcheck[fontptr].b0-0);
	dviptr:=dviptr+1;
	IF dviptr=dvilimit THEN
	  dviswap;
	END;
	BEGIN
	dvibuf[dviptr]:=(fontcheck[fontptr].b1-0);
	dviptr:=dviptr+1;
	IF dviptr=dvilimit THEN
	  dviswap;
	END;
	BEGIN
	dvibuf[dviptr]:=(fontcheck[fontptr].b2-0);
	dviptr:=dviptr+1;
	IF dviptr=dvilimit THEN
	  dviswap;
	END;
	BEGIN
	dvibuf[dviptr]:=(fontcheck[fontptr].b3-0);
	dviptr:=dviptr+1;
	IF dviptr=dvilimit THEN
	  dviswap;
	END;
	dvifour(fontsize[fontptr]);
	BEGIN
	dvibuf[dviptr]:=(strstart[fontarea[fontptr]+1]-strstart[fontarea[
									 fontptr]]);
	dviptr:=dviptr+1;
	IF dviptr=dvilimit THEN
	  dviswap;
	END;
	BEGIN
	dvibuf[dviptr]:=(strstart[fontname[fontptr]+1]-strstart[fontname[
									 fontptr]]);
	dviptr:=dviptr+1;
	IF dviptr=dvilimit THEN
	  dviswap;
	END;
	{551}
	FOR k:=strstart[fontarea[fontptr]]TO strstart[fontarea[fontptr]+1]
	-1 DO
	  BEGIN
	  dvibuf[dviptr]:=strpool[k];
	  dviptr:=dviptr+1;
	  IF dviptr=dvilimit THEN
	    dviswap;
	  END;
	FOR k:=strstart[fontname[fontptr]]TO strstart[fontname[fontptr]+1]-1 DO
	  BEGIN
	  dvibuf[dviptr]:=strpool[k];
	  dviptr:=dviptr+1;
	  IF dviptr=dvilimit THEN
	    dviswap;
	  END;
	END;
      fontptr:=fontptr-1;
      END;
    dvifour(-1);
    dvifour(lastbop);
    BEGIN
    dvibuf[dviptr]:=2;
    dviptr:=dviptr+1;
    IF dviptr=dvilimit THEN
      dviswap;
    END;
    k:=4+((dvibufsize-dviptr)MOD 4);
    WHILE k>0 DO
      BEGIN
      BEGIN
      dvibuf[dviptr]:=223;
      dviptr:=dviptr+1;
      IF dviptr=dvilimit THEN
	dviswap;
      END;
      k:=k-1;
      END;
    {510}
    IF dvilimit=halfbuf THEN
      writedvi(halfbuf,dvibufsize-1);
    IF dviptr>0 THEN
      writedvi(0,dviptr-1);
    printnl(575);
    print(outputfilena);
    printchar(46);
    bclose(dvifile);
    END;
  {1224}
  FOR k:=0 TO 15 DO
    IF sendopen[k]THEN
      aclose(sendfile[k]);
  {IF EQTB[3614].INT<>0 THEN[1190]PRINTNL(982);
  PRINTINT(MAXVARUSED);
  PRINTCHAR(44);
  PRINTINT(MEMEND-12000);
  PRINTLN;
  PRINTINT(CSCOUNT);
  PRINT(983);
  PRINTLN;
  PRINTINT(TOTALPAGES);
  PRINT(984)PRINTINT(DIVPTR);
  PRINT(985);}
  IF jobname<>0 THEN
    BEGIN
    Writeln(errfile);
    aclose(errfile);
    END;
  END;
  {1191}
PROCEDURE Finalcleanup;
  LABEL
    30,10;
  VAR
    c:smallnumber;
    k:smallnumber;
  BEGIN
  c:=curchr;
  IF jobname=0 THEN
    openerrfile;
  {1192}k:=0;
  WHILE true DO
    BEGIN
    buildpage;
    IF 12002=pagetail THEN
      GOTO 30;
    BEGIN
    mem[curlist.tailfield].hh.rh:=newnullbox;
    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    END;
    mem[curlist.tailfield+1].int:=eqtb[4008].int;
    BEGIN
    mem[curlist.tailfield].hh.rh:=newpenalty(-10000);
    curlist.tailfield:=mem[curlist.tailfield].hh.rh;
    END;
    k:=k+1;
    IF k>25 THEN
      BEGIN
      printnl(988);
      GOTO 30;
      END;
    END;
  30:;
  IF curlevel>0 THEN
    BEGIN
    printnl(986);
    printint(curlevel);
    printchar(41);
    END;
  IF c=1 THEN
    BEGIN
    Storefmtfile;
    GOTO 10;
    printnl(987);
    END;
  10:
  END;
  {1194}
PROCEDURE Initprim;
  BEGIN
  nonewcontrol:=false;
  {216}primitive(226,73,0);
  primitive(227,73,1);
  primitive(228,73,2);
  primitive(229,73,3);
  primitive(230,73,4);
  primitive(231,73,5);
  primitive(232,73,6);
  primitive(233,73,7);
  primitive(234,73,8);
  primitive(235,73,9);
  primitive(236,73,10);
  primitive(237,73,11);
  primitive(238,73,12);
  primitive(239,73,13);
  primitive(240,73,14);
  primitive(241,73,15);
  primitive(242,73,16);
  {219}primitive(244,70,2635);
  primitive(245,70,2636);
  {224}primitive(246,71,0);
  primitive(247,71,1);
  primitive(248,71,2);
  primitive(249,71,3);
  primitive(250,71,4);
  primitive(251,71,5);
  primitive(252,71,6);
  primitive(253,71,7);
  primitive(254,71,8);
  primitive(255,71,9);
  primitive(256,71,10);
  primitive(257,71,11);
  primitive(258,71,10);
  primitive(259,71,13);
  primitive(260,71,14);
  primitive(261,71,15);
  primitive(262,71,16);
  primitive(263,71,17);
  primitive(264,71,18);
  primitive(265,71,19);
  primitive(266,71,20);
  primitive(267,71,21);
  primitive(268,71,22);
  primitive(269,71,23);
  primitive(270,71,24);
  primitive(271,71,25);
  primitive(272,71,26);
  primitive(273,71,27);
  primitive(274,71,28);
  primitive(275,71,29);
  primitive(276,71,30);
  primitive(277,71,31);
  primitive(278,71,32);
  primitive(279,71,33);
  primitive(280,71,34);
  primitive(281,71,35);
  primitive(282,71,36);
  {229}primitive(284,72,0);
  primitive(285,72,1);
  primitive(286,72,2);
  primitive(287,72,3);
  primitive(288,72,4);
  primitive(289,72,5);
  primitive(290,72,6);
  primitive(291,72,7);
  primitive(292,72,8);
  primitive(293,72,9);
  primitive(294,72,10);
  primitive(295,72,11);
  primitive(296,72,12);
  primitive(297,72,13);
  primitive(298,72,14);
  primitive(299,72,15);
  primitive(300,72,16);
  {246}primitive(306,0,0);
  primitive(307,81,0);
  primitive(308,16,0);
  primitive(309,17,0);
  primitive(310,18,0);
  primitive(311,19,0);
  primitive(312,40,0);
  primitive(313,83,0);
  primitive(58,78,0);
  primitive(314,79,0);
  primitive(315,66,0);
  primitive(316,88,0);
  primitive(317,24,0);
  primitive(318,25,0);
  primitive(319,68,0);
  primitive(320,32,0);
  primitive(321,33,0);
  primitive(322,34,0);
  primitive(323,35,0);
  primitive(324,36,0);
  primitive(189,37,0);
  primitive(208,38,0);
  primitive(325,39,0);
  primitive(326,89,0);
  primitive(47,42,0);
  primitive(327,43,0);
  primitive(328,44,0);
  primitive(329,15,0);
  primitive(330,49,0);
  primitive(331,52,0);
  primitive(332,53,0);
  primitive(333,62,0);
  primitive(334,60,0);
  primitive(335,61,0);
  primitive(32,63,0);
  primitive(336,64,0);
  {310}primitive(383,13,0);
  parloc:=curval;
  partoken:=4096+parloc;
  {343}primitive(412,93,0);
  primitive(413,93,1);
  primitive(414,93,2);
  primitive(415,93,3);
  primitive(416,93,4);
  {369}primitive(443,67,0);
  primitive(444,67,1);
  primitive(445,67,2);
  primitive(446,75,17);
  primitive(447,65,0);
  primitive(448,65,1);
  {374}primitive(451,69,93);
  primitive(452,69,1);
  {672}primitive(355,4,128);
  primitive(357,5,129);
  {915}primitive(697,14,0);
  primitive(698,14,1);
  {927}primitive(708,26,4);
  primitive(709,26,0);
  primitive(710,26,1);
  primitive(711,26,2);
  primitive(712,26,3);
  primitive(713,27,4);
  primitive(714,27,0);
  primitive(715,27,1);
  primitive(716,27,2);
  primitive(717,27,3);
  primitive(193,28,5);
  primitive(196,29,0);
  primitive(197,30,98);
  {940}primitive(738,22,1);
  primitive(739,22,0);
  primitive(740,23,1);
  primitive(741,23,0);
  primitive(742,21,0);
  primitive(743,21,1);
  primitive(744,21,2);
  primitive(745,21,3);
  primitive(746,21,4);
  primitive(747,21,5);
  primitive(748,21,97);
  primitive(749,31,100);
  primitive(750,31,101);
  primitive(751,31,102);
  {958}primitive(765,41,1);
  primitive(766,41,0);
  {984}primitive(45,45,1);
  primitive(204,45,0);
  {1012}primitive(804,46,0);
  primitive(805,46,1);
  {1026}primitive(598,48,15);
  primitive(599,48,16);
  primitive(600,48,17);
  primitive(601,48,18);
  primitive(602,48,19);
  primitive(603,48,20);
  primitive(604,48,21);
  primitive(606,48,25);
  primitive(605,48,26);
  {1038}primitive(593,51,0);
  primitive(594,51,2);
  primitive(595,51,4);
  primitive(596,51,6);
  {1045}primitive(822,50,0);
  primitive(823,50,1);
  primitive(824,50,2);
  primitive(609,50,3);
  primitive(825,50,4);
  primitive(826,50,5);
  {1054}primitive(607,47,29);
  primitive(608,47,30);
  {1073}primitive(839,55,0);
  primitive(840,55,1);
  primitive(841,55,2);
  primitive(842,55,3);
  primitive(843,55,4);
  primitive(844,55,5);
  primitive(845,55,6);
  primitive(846,55,7);
  primitive(847,55,8);
  primitive(848,55,9);
  {1090}primitive(867,80,1);
  primitive(868,80,2);
  primitive(869,80,4);
  primitive(870,82,0);
  primitive(871,82,1);
  primitive(872,82,2);
  primitive(873,82,3);
  {1105}primitive(889,76,2943);
  primitive(890,76,3071);
  primitive(891,76,3199);
  primitive(892,76,3327);
  primitive(893,76,3455);
  primitive(894,76,3876);
  primitive(614,77,2894);
  primitive(615,77,2910);
  primitive(616,77,2926);
  {1110}primitive(902,84,0);
  primitive(903,84,1);
  primitive(904,84,2);
  primitive(905,85,0);
  primitive(906,85,1);
  primitive(907,85,2);
  primitive(908,86,0);
  primitive(909,86,1);
  primitive(910,86,2);
  primitive(911,87,0);
  primitive(912,87,1);
  primitive(913,87,2);
  {1120}primitive(925,90,0);
  primitive(926,90,1);
  {1130}primitive(935,91,0);
  primitive(936,91,1);
  primitive(937,91,2);
  primitive(938,91,3);
  {1136}primitive(939,58,0);
  primitive(940,58,1);
  {1144}primitive(946,54,3199);
  primitive(947,54,3327);
  {1149}primitive(948,20,0);
  primitive(949,20,1);
  primitive(950,20,2);
  primitive(951,20,3);
  {1202}primitive(989,59,0);
  primitive(990,59,1);
  primitive(991,59,2);
  primitive(992,59,3);;
  nonewcontrol:=true;
  END;

  {1196}{PROCEDURE DEBUGHELP;
	LABEL 889,888,10;
	VAR K,L,M,N:INTEGER;
	BEGIN GOTO 889;
	888:['*************breakpoint*************';
	'***********for**debugging***********'];
	889:WHILE TRUE DO BEGIN WRITE(TERMOUT,'#');
	BREAK(TERMOUT);
	READ(TERMIN,M);
	IF M<0 THEN GOTO 10;
	IF M=0 THEN GOTO 888;
	READ(TERMIN,N);
	CASE M OF[1197]1:PRINTMEMORYW(MEM[N]);
	2:PRINTINT(MEM[N].HH.LH);
	3:PRINTINT(MEM[N].HH.RH);
	4:PRINTMEMORYW(EQTB[N]);
	5:PRINTMEMORYW(FONTINFO[N]);
	6:PRINTMEMORYW(SAVESTACK[N]);
	7:SHOWBOX(N);
	8:BEGIN BREADTHMAX:=1000;
	DEPTHTHRESHO:=POOLSIZE-POOLPTR-10;
	SHOWNODELIST(N);
	END;
	9:TOKENSHOW(N);
	10:CHECKMEM(N>0);
	11:SEARCHMEM(N);
	12:BEGIN READ(TERMIN,L);
	PRINTCMDCHR(N,L);
	END;
	13:FOR K:=1 TO N DO PRINT(XCHR[BUFFER[K]]);
	14:BEGIN FONTINSHORTD:=0;
	SHORTDISPLAY(N);
	END;
	OTHERS:WRITE(TERMOUT,'?')END;
	END;
	10:END;
  }{1188}
BEGIN
1:
Rewrite(termout,'TTY:','/O');
IF readyalready=314159 THEN
  GOTO 2;
initialize;
{13}bad:=0;
IF(halferrorlin<30)OR(halferrorlin>errorline-15)THEN
  bad:=1;
IF maxprintline<60 THEN
  bad:=2;
IF dvibufsize MOD 8<>0 THEN
  bad:=3;
IF(12000<100)OR(12100>memmax)THEN
  bad:=4;
IF 1777>2100 THEN
  bad:=5;
{105}
IF(0>0)OR(255<127)THEN
  bad:=11;
IF(0>0)OR(65535<32767)THEN
  bad:=12;
IF(0<0)OR(255>65535)THEN
  bad:=13;
IF(0<0)OR(memmax>=65535)THEN
  bad:=14;
IF(0<0)OR(fontmax>255)THEN
  bad:=15;
IF(savesize>65535)OR(maxstrings>65535)THEN
  bad:=16;
IF(bufsize>65535)THEN
  bad:=17;
{269}
IF 6456>65535 THEN
  bad:=21;
{437}
IF 22>filenamesize THEN
  bad:=31;
{1119}
IF 2*65535<12000 THEN
  bad:=41;
IF bad>0 THEN
  BEGIN
  Write(termout,
	'Ouch---my internal constants have been clobbered!');
  Write(termout,'---case ',bad:0);
  GOTO 9999;
  END;
{1193}
IF NOT initstrings THEN
  GOTO 9999;
Initprim;
{657}magicoffset:=strstart[625]-9*15;
GOTO 2;
{657}magicoffset:=strstart[625]-9*15;
2:
fixdateandti;
{54}selector:=17;
tally:=0;
offset:=0;
{58}Write(termout,'This is TeX, Version 0');
IF formatident=0 THEN
  Writeln(termout,' (no format preloaded)')
ELSE
  BEGIN
  print(formatident);
  println;
  END;
{449}outputfilena:=0;;
{1195}
BEGIN{307}
BEGIN
inputptr:=0;
inopen:=0;
paramptr:=0;
scannerstatu:=0;
First:=0;
curinput.statefield:=33;
curinput.startfield:=0;
curinput.indexfield:=0;
line:=0;
curinput.namefield:=0;
alignstate:=1000000;
IF NOT initterminal THEN
  GOTO 9999;
END;
IF formatident=0 THEN
  BEGIN
  IF NOT Openfmtfile THEN
    GOTO 9999;
  IF NOT Loadfmtfile THEN
    GOTO 9999;
  WHILE(curinput.locfield<curinput.limitfield)AND(buffer[curinput.locfield
  ]=32)DO curinput.locfield:=curinput.locfield+1;
  END;
buffer[curinput.limitfield]:=13;
{71}
IF interaction=0 THEN
  selector:=16
ELSE
  selector:=17;
IF(curinput.locfield<curinput.limitfield)AND(eqtb[2943+buffer[curinput.
							      locfield]].hh.rh<>0)THEN
  startinput;
END;
Maincontrol;
Finalcleanup;
9998:
Closefilesan;
9999:
END.